views:

38

answers:

3

I want to copy all the tables, fields, and data from my local server mysql to my hosting sites mysql. Is there a way to copy all the data? (It's only 26kb, very small)

+2  A: 

In phpMyAdmin, just export a dump (using the export) tab and re-import it on the other server using the sql tab.

Make sure you compare the results, I have had phpMyAdmin screw up the import more than once.

If you have shell access to both servers, a combination of

mysqldump -u username -p databasename > dump.sql

and a

mysql -u username -p databasename < dump.sql

on the target server is the much more fast and reliable alternative in my experience.

Pekka
wow that was easy. Thanks! haha
ggfan
A: 

If you have the same version of mysql on both systems (or versions with compatible db file sytsem), you may just copy the data files directly. Usually files are kept in /var/lib/mysql/ on unix systems.

Andriy Bohdan
You should stop the server before doing this, though, as far as I know.
Pekka
yes, stop or exec "flush tables with read lock"to flush all data onto disk and prevent any new writes
Andriy Bohdan