database permissions

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
I've got databases on one box i have to
transfer to another box, both are running Linux one a Centos4 machine, the
other rh9 i think. I could tar up the /var/lib/mysql directory, but i
was lead to believe that was a bad idea. I don't know the permissions of the
user's and i don't want to give out global permissions. What i was wondering
is there a way i can do a mysqldump on the databases on machine1, which will
drop everything needed to recreate them in to a .sql file, transfer that to
machine2 and then use mysqladmin to load it and have all the settings back
in business? I believe they're both mysql4 installs, though machine1 might
be mysql3.23, not sure.
Thanks a lot.

Re: database permissions

Quoted text here. Click to load it

The users and privileges are all recorded in the "mysql" database (that  
is, a database named "mysql").  You should be able to back this up using  
mysqldump on machine1, and restore it on machine2 using the mysql  
command-line tool to run the backup as a SQL script.

Quoted text here. Click to load it

The schema of the mysql database changes from release to release.
You may need to run the "mysql_fix_privilege_tables" script to upgrade the  
schema after you restore it.


Bill K.

Site Timeline