Home > MySQL Help > moving database from 1 server to another

moving database from 1 server to another



When I move my site which uses a MySQL database, how would I move the whole database from the old MySQL server to the new one? URL

    
Guest


You could use mysqldump to export the current db to textfile format, and import the output from mysqldump on your new server using the following:
mysqldump -p mydb --add-drop-table > mydb.sql (on your current server)
then upload the file mydb.sql to your new server (you could use gzip to compress it)
mysql -p mydb < mydb.sql (on your new server)

Was this answer helpful ? Yes No   
Guest
 
 
Home - About Infoqu - Contact - Privacy Statement - Link to Infoqu - Bookmark Infoqu

Copyright 2007-2010 by Infoqu. All rights reserved