Synchronize MySQL remote & local database using phpMyAdmin

前端 未结 5 1980
心在旅途
心在旅途 2020-12-13 14:40

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.

5条回答
  •  庸人自扰
    2020-12-13 15:37

    Open phpMyAdmin/config.inc.php and add these lines about "Server Configuration".

    $i++;
    $cfg['Servers'][$i]['host']          = ''; // 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']          = '';     // Remote MySQL user
    $cfg['Servers'][$i]['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

提交回复
热议问题