有没有办法将mysql数据库中的所有数据复制到另一个?(phpmyadmin)

2022-01-05 00:00:00 mysql 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.

如果您对两台服务器都有 shell 访问权限,则组合使用

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.

相关文章