faqts : Computers : Programming : Languages : PHP : Database Backed Sites : MySQL

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

66 of 75 people (88%) answered Yes
Recently 7 of 10 people (70%) answered Yes

Entry

What's the easiest way to move MySQL data between servers?
How can I move my MySQL tables and data up to my web host?

Feb 28th, 2005 00:49
Kaan Turel, Nathan Wallace,


The easiest way is to just dump it and import it.

On you development machine:

    mysqldump database_name > dump.sql

Then ftp dump.sql up to your web host and import the data into the MySQL
database there:

    mysql -p ... database_name < dump.sql

You can also dump one table at a time:

    mysqldump database table > table.sql

    e.g.
    mysqldump vwr salesrep > salesrep.sql
    mysqldump vwr blahblah > blahblah.sql


Remember, all the MySQL utilities support the --help option.  Try:

    mysqldump --help
>>>>>>>
Kaan's addition :
Also ... if this is the method you choose (which I suggest) preferably  
drop your existing db before restoring. (also .. i prefer scp)
>>>>>>>