Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
409 views
in Technique[技术] by (71.8m points)

php - Synchronize MySQL remote & local database using 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.

I have given permissions to all IP to connect remotely.

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.

And when I synchronize the database by clicking Synchronize Database button and again do synchronization. It again shows same structure synchronization.

See image below enter image description here

If anyone have alternate solution for it please also tell that. Local Details OS: Windows7 Software: EasyPHP12.0 Remote Details Server: Linux Cpanel PhpMyAdmin

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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

Now there is a 'servers' dropdown on your phpMyAdmin front page. Pick your sever and bingo!

Credits: codejourneymen

And, there are a lot of example, maybe help:

phpadmin remote database


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...