PDA

View Full Version : MySQL question



KapTinKiRk
November 12th, 2000, 14:57
I don't know much about MySQL or databases in general, so this might sound stupid to those in the know.

But say I have a MySQL database on a host, then I need to move servers. Can I simply back up the database, or download it and then upload it to the new server, and have it work?

jvv
November 12th, 2000, 16:41
Yes it's possible, you can do it using the mysqldump command. You can find full instuctions on the mysql documentation pages. This should be the actual section:

http://www.mysql.com/documentation/mysql/commented/manual.php?section=mysqldump

You should be able to get a .sql file this way which you can download and move to the new server.

To load it in the new database, use:



mysql [-uusername] [-p] [database] < yourdumpfile.sql

KapTinKiRk
November 12th, 2000, 17:05
Thanks, i didn't even think of going to the MySQL site :( .. silly me.

Technics
November 12th, 2000, 17:28
Silly you :P.

Thanks for that bit of code always wondered if that was possible.