Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way to copy all the data in a mysql database to another? (phpmyadmin)

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)

like image 392
ggfan Avatar asked Apr 10 '10 17:04

ggfan


1 Answers

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.

like image 79
Pekka Avatar answered Sep 21 '22 00:09

Pekka