PDA

View Full Version : [ubuntu] Can i copy a mysql database?



Orange Kingdom
April 1st, 2010, 12:55 AM
Hi,

Can i just copying a mysql database to another server?
I know there is mysqldump but why not just with the cp command?

wojox
April 1st, 2010, 01:03 AM
That's what mysqldump primarily is.

new_tolinux
April 1st, 2010, 01:15 AM
You can use cp, but then you have to stop the mysql server.

After that you can simply copy the folders you need to your new mysql server.
I would suggest not to copy the folder of the mysql database itself, because the other server will have this folder of it's own (and there is a service account for Ubuntu specified in it).

Orange Kingdom
April 1st, 2010, 01:29 AM
Ok, thanks.

And what about the user accounts like privileges etc. Will they also be copieed?