First off.... I'm new to MySQL, my co-admin set it up originally, who for the life of me I can not get a hold of. So everything I should have done, was not done, because I didn't know any better.
Second, your instructions are foreign to me as I do not know tit for tat.
Then we perhaps need to write them out...
Third, For the life of me I can not GRANT access to my user. I ran into this issue 2 years ago, and for the life of me I do not remember how we got it done.
(example not actual user or pass)
#GRANT ALL ON *.* TO 'user2'@'localhost' IDENTIFIED BY 'pass1'
When I go to phpmyadmin it tells me grant NO
Not sure what you are doing wrong there, but have a look here:
http://wiki.contribs.org/MySQLI've used SME for 10 years now, and I'm beginning to think of using another solution, just because of the complications with MySQL
I think MySQL works perfectly on SME Server.
lack of PHP5 and MySQL5
I can imagine that.
and that 75 character root password.
Which you do not need at all, so why are you bothered by that? If you login as root user to the SME Server command line you should be able to access MySQL simply by typing
mysql
.
If you are using the root password because you think your applications need access to the database you are doing very dangerous things as the root user is a super user (for MySQL as well in this case) and has far more rights than any application should have. If you create the proper user, with the proper privileges on the proper database/tables things should work out.
If you already have 10 years of experience with SME Server I do not understand why you have not posted you issues in the forums/bugtracker as I think above problems could have been easily resolved.
Prove me wrong, help me, don't scold me!
I will if you let me:
Please follow these steps and if something does not work (as expected) stop. Post back here and do not wander of on your own in the forest of SME Server and MySQL, you might not see the forrest for the trees.1. Setup a test box with SME Server, I am serious do not try this on your production machine as it might brake stuff.
2. Log in as root
3. Verify that you can login as root user into mysql without any password or username with the following command:
mysql
Above command should get you on the mysql prompt.
4. Type
quit
to return to the SME Server shell.
5. Now it is time to somehow retrieve the data form your backup disk and place it somewhere on the MySQL server, I suggest somewhere in a separate folder in /tmp, I assume you use /tmp/restore for a minute.
6. To stop mysql type
service mysqld stop
7. Verify that MySQL is not available anymore by issuing the following command:
mysql
Above should return something like this:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
8. Now select one database that is not on the system, not being the MySQL database from /tmp/restore and copy the folder to /var/lib/mysql/
9. Check that it is there:
ls -la /var/lib/mysql
Which should look more or less like this:
total 20
drwxr-xr-x 5 mysql mysql 4096 Feb 1 18:56 .
drwxr-xr-x 20 root root 4096 Feb 1 16:56 ..
drwx------ 2 mysql mysql 4096 Feb 1 16:58 horde
drwx------ 2 mysql mysql 4096 Feb 1 18:40 mysql
drwx------ 2 mysql mysql 4096 Feb 1 16:58 test
You might have some extra databases there as well as the one you restored.
10. Changes are very likely that ownership is not mysql mysql like above, wo we need to fix that by doing:
chown -R mysql:mysql /var/lib/mysql/database
where you should replace database with the name of the database you restored.
11. Now we should be ready to restart mysql:
service mysqld start
Above should output something like this:
Starting mysqld: [ OK ]
12. If MySQL started succesfully we can try and login to mysql again:
mysql
13. Try and see if you can see the database you restored by issuing the following command on the MySQL prompt:
SHOW DATABASES;
It should list the same databases as you have seen in step 9.
14. Quit MySQL again by typing:
quit
15. Now we need to check the integrity of the databases and tables you just restored:
mysqlcheck --all-databases
If all is well this will print out a list of all databases and tables with the result of the check, hope for the best all should have OK behind them if not please post the output in this thread.
If restore shows all tables OK you can make a dump file of the restored database which you can install on your production box:
16. Make a dump of the restired database like this
mysqldump --opt --database databasename > /tmp/database.sql
17. Somehow transfer the /tmp/database.sql file to your production box.
18. Login on your production server as root.
19. Restore the database with the following command:
mysql < /path/to/database.sql
20. Login to mysql
mysql
21. Check that the restored database is available:
SHOW DATABASES;
Once again, if you encounter any error in this process, please stop and post back here.