转储所有数据库并重新导入另一台服务器上?(Dump all databases and reimport on another server?)

编程入门 行业动态 更新时间:2024-10-21 11:58:36
转储所有数据库并重新导入另一台服务器上?(Dump all databases and reimport on another server?)

这真的很简单,我只是无法弄清楚语法。

我想在另一台服务器上复制我的服务器设置。

我可以转储所有数据库

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.sql

But 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/

更多推荐

本文发布于:2023-08-04 10:00:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1415179.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:另一台   器上   数据库   Dump   reimport

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!