database permissions
am 28.03.2006 09:37:21 von dave
Hello,
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.
Dave.
Re: database permissions
am 28.03.2006 23:23:53 von Bill Karwin
On Mon, 27 Mar 2006 23:37:21 -0800, Dave wrote:
> 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?
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.
> I believe they're both mysql4 installs, though machine1 might
> be mysql3.23, not sure.
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.
See
http://dev.mysql.com/doc/refman/4.1/en/mysql-fix-privilege-t ables.html
Regards,
Bill K.