有没有一种方法可以将mysql数据库中的所有数据复制到另一个数据库? (phpmyadmin) [英] Is there a way to copy all the data in a mysql database to another? (phpmyadmin)
问题描述
我想将所有表,字段和数据从本地服务器mysql复制到托管站点mysql.有没有办法复制所有数据? (只有26kb,非常小)
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)
推荐答案
在phpMyAdmin中,只需导出转储(使用export
)选项卡,然后使用sql
选项卡将其重新导入另一台服务器上.
In phpMyAdmin, just export a dump (using the export
) tab and re-import it on the other server using the sql
tab.
确保您比较结果,我已经多次将phpMyAdmin弄乱了导入.
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
和一个
mysql -u username -p databasename < dump.sql
根据我的经验,在目标服务器上
是更快捷,更可靠的选择.
on the target server is the much more fast and reliable alternative in my experience.
这篇关于有没有一种方法可以将mysql数据库中的所有数据复制到另一个数据库? (phpmyadmin)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!