Quote:
Originally posted by HQ
Please give me an example of how to dump the file.sql with mysqldump command. I am not sure which options to use. Should I use "--add-drop-table"?
I do not want to delete the databases, I just want a perfect copy of them for the new server.
|
Ok, here is what you want:
/path/to/mysqldump -u username -p dbname > dbdumpfile.sql
Now you have a dump of the entire database, as of that moment. You don't need to stop your db server, you don't need to reboot or anything like that, just run this command.
Then, SSH to you new server and run mysql:
/path/to/mysql -u root -p
(once logged in and create your db...)
> CREATE DATABASE dbname;
(now create the user you want)
> GRANT all on dbname.* to username@localhost identified by 'passwordhere';
(you can modify the privileges if you dont want to give all)
(now log out and dump your old db in)
> quit
/path/to/mysql -u username -p dbname < dbdumpfile.sql
and presto your db is now in your new mysql.
(note it will always prompt you for a password when doing this.)
If you need more help, just contact us through our URL and we'll
set you up.
PxG