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

前端 未结 4 404
你的背包
你的背包 2021-01-18 07:27

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)

4条回答
  •  野趣味
    野趣味 (楼主)
    2021-01-18 08:18

    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.

提交回复
热议问题