我正在使用 CodeIgniter 和 MySQL 开发 Web 应用程序。
我需要设置一个功能,在没有互联网连接时更新本地服务器中 MySQL 中的数据,然后在连接可用时切换到实时服务器,并将本地保存的数据也恢复到实时数据库中。
(可能有客户端 1)在远程位置,互联网连接不佳,我需要这个想法,以及 2)其他可以直接将数据添加到实时服务器的客户端。
有什么机制可以做到这一点吗?
最佳答案
Mysql数据库复制
Replication enables data from one MySQL database server (the master) to be replicated to one or more MySQL database servers (the slaves). Replication is asynchronous - slaves need not be connected permanently to receive updates from the master. This means that updates can occur over long-distance connections and even over temporary or intermittent connections such as a dial-up service. Depending on the configuration, you can replicate all databases, selected databases, or even selected tables within a database.
关于php - 使用 PHP 将 MySQL 从本地主机恢复到实时服务器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32210117/