这真的很简单,我只是无法弄清楚语法。
我想在另一台服务器上复制我的服务器设置。
我可以转储所有数据库
mysqldump -uroot -p --alldatabases > all.sql但是,如何将所有这些导入另一台服务器上的全新mysql设置?
It's quite simple really, I just can't figure out the syntax.
I want to replicate my server setup on another server.
I can dump all my databases with
mysqldump -uroot -p --alldatabases > all.sqlBut how do I import ALL of those into a brand new mysql setup on another server?
最满意答案
如果数据库服务器的版本接近,则可以简单地rsync / var / lib / mysql目录。
rsync /var/lib/mysql root@destination.server.com:/var/lib/ -a
编辑:请注意,这种方法有一些问题,需要一些额外的步骤: http : //verens.com/2016/05/11/quick-method-to-clone-a-mysql-database/
if the database servers are both near enough the same version, you could simply rsync the /var/lib/mysql directory over.
rsync /var/lib/mysql root@destination.server.com:/var/lib/ -a
Edit: Please note that there are some issues with this approach which require some additional steps: http://verens.com/2016/05/11/quick-method-to-clone-a-mysql-database/
更多推荐
发布评论