MySql phpMyAdmin:自动复制/同步两个数据库 [英] MySql phpMyAdmin: Replicating/Synchronizng two Database automatically

查看:273
本文介绍了MySql phpMyAdmin:自动复制/同步两个数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在两个不同的服务器上有两个相同的数据库,并且我想同步两个数据库.

I have two same database on two different server, and I want to synchronize both database.

例如,如果我执行插入",更新",删除",更改",删除"等任何处理,它也会自动反映在其他数据库上.

For example, If I do any process like Insert, Update, Delete, Alter, Drop, etc it also reflect on other database automatically.

我已经在本地服务器上尝试过,但是每次必须手动进行.

I had tried it on my local server, but every time I have to do it manually.

有什么方法可以自动执行此操作,假设我插入一条记录并将其自动插入到其他数据库中.

Is there any way to do it automatically, suppose I Insert a record and it automatically inserted into other database.

推荐答案

您在说的就是复制".

What you're talking about is called 'Replication'.

如果您要对两个数据库进行更改,并希望它们显示在另一个数据库中,则需要一个Master/Master对.

If you are going to be making changes to both databases and expect it to show up in the other, you need a Master/Master pair.

在此处了解有关信息: https: //dba.stackexchange.com/questions/9424/best-way-to-setup-master-to-multi-master-replication

Have a read about it here: https://dba.stackexchange.com/questions/9424/best-way-to-setup-master-to-multi-master-replication

这篇关于MySql phpMyAdmin:自动复制/同步两个数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆