问题描述
我有一个本地MySQL数据库,该数据库偶尔会更改,当它更改时,我想将其与远程数据库同步.我正在使用PhpMyAdmin的同步选项.
I have local MySQL database which changes occasionally, when it changes I want to synchronize it with Remote database. I am using PhpMyAdmin's synchronize option for it.
我已授予所有IP远程连接的权限.
I have given permissions to all IP to connect remotely.
问题:当我想使用PhpMyAdmin的syncize选项将远程数据库与本地数据库同步时.它仅显示数据库结构差异,但两个数据库上的数据也不同,但未显示该差异.
Problem:When I want to synchronize remote database with local database using synchronize option of PhpMyAdmin. It only shows the database structure difference but data is also different on both the databases but it is not showing that difference.
当我通过单击Synchronize Database
按钮同步数据库并再次进行同步时.再次显示相同的结构同步.
And when I synchronize the database by clicking Synchronize Database
button and again do synchronization. It again shows same structure synchronization.
请参见下图
如果有人有替代解决方案,请也告诉我.本地详细信息操作系统:Windows7软体:EasyPHP12.0远程详细信息服务器:Linux CpanelPhpMyAdmin
If anyone have alternate solution for it please also tell that.Local DetailsOS: Windows7Software: EasyPHP12.0Remote DetailsServer: Linux CpanelPhpMyAdmin
推荐答案
打开phpMyAdmin/config.inc.php
并添加有关服务器配置" 的这些行.
Open phpMyAdmin/config.inc.php
and add these lines about "Server Configuration".
$i++;
$cfg['Servers'][$i]['host'] = '<remote-server-address>'; // Remote MySQL hostname or IP address
$cfg['Servers'][$i]['port'] = ''; // MySQL port - leave blank for default port
$cfg['Servers'][$i]['socket'] = ''; // Path to the socket - leave blank for default socket
$cfg['Servers'][$i]['connect_type'] = 'tcp'; // How to connect to MySQL server ('tcp' or 'socket')
$cfg['Servers'][$i]['extension'] = 'mysql'; // The php MySQL extension to use ('mysql' or 'mysqli')
$cfg['Servers'][$i]['compress'] = FALSE; // Use compressed protocol for the MySQL connection
$cfg['Servers'][$i]['auth_type'] = 'config'; // Authentication method (config, http or cookie based)?
$cfg['Servers'][$i]['user'] = '<db-username>'; // Remote MySQL user
$cfg['Servers'][$i]['password'] = '<db-password>'; // Remote MySQL password
信用: codejourneymen
还有很多例子,也许有帮助:
And, there are a lot of example, maybe help:
这篇关于同步MySQL远程&使用phpMyAdmin的本地数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!