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)
views:
38answers:
3
+2
A:
Have a look at
Copying MySQL Databases to Another Machine
Copy MySQL database from one server to another remote server
astander
2010-04-10 17:01:33
+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
2010-04-10 17:05:34
wow that was easy. Thanks! haha
ggfan
2010-04-10 17:12:18
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
2010-04-10 17:05:45
yes, stop or exec "flush tables with read lock"to flush all data onto disk and prevent any new writes
Andriy Bohdan
2010-04-10 17:18:00