简体   繁体   English

使用PHP将MySQL从本地主机还原到实时服务器

[英]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.

相关问题 如何使用php将mysql DB从本地主机复制到服务器? - how to copy mysql DB from localhost to server using php? 从实时 php 文件在我的本地主机上执行 mysql 查询? - execute mysql queries on my localhost from a live php file? 使用PHP将数据库从实时服务器导出到本地主机? - Export database from my live server to my localhost with php? 从本地主机移至实时服务器时,PHP登录中断 - Php login breaks when moved to live server from localhost PHP套接字服务器在本地主机上工作,但在实时服务器上不工作 - php socket server works on localhost but not on live server 使用GoDaddy cPanel将Wordpress网站从本地主机移动到实时服务器 - Moving wordpress site from localhost to live server using GoDaddy cPanel php: @fopen 在 localhost 中工作,但在实时服务器中无效 - php: @fopen works in localhost but not in live server php header()在本地主机上工作,但在实时服务器上不工作? - php header() working in localhost but not working on live server? PHP标头可在localhost上运行,但不能在实时服务器上运行 - PHP header working on localhost but not on live server php登录页面在localhost中有效,但在实时服务器中无效 - php login page worked in localhost but not in live server
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM