[英]Restoring MySQL from localhost to live server using PHP
I am developing a web application in CodeIgniter and MySQL. 我正在使用CodeIgniter和MySQL开发Web应用程序。
I need to set up a function to update data in MySQL in my local server when there is no internet connection and later switch to live server when the connections are available, restore the locally saved data into live database as well. 我需要设置一个功能来在没有互联网连接时在本地服务器中更新MySQL中的数据,然后在连接可用时切换到实时服务器,并将本地保存的数据也还原到实时数据库中。
(There may be clients 1) at remote location who have poor internet connectivity which I need this idea for and 2) the other who can add data directly to the live server). (可能有1个客户端,远程客户端的Internet连接性较差,我需要这个想法,而2个客户端可以将数据直接添加到实时服务器中)。
Is there any mechanism to get this done? 有什么机制可以做到这一点吗?
Mysql Database Replication MySQL数据库复制
Replication enables data from one MySQL database server (the master) to be replicated to one or more MySQL database servers (the slaves).
复制使数据可以从一台MySQL数据库服务器(主服务器)复制到一台或多台MySQL数据库服务器(从服务器)。 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.
根据配置,您可以复制数据库中的所有数据库,选定的数据库甚至选定的表。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.