Introduction
In some cases, you may wish to see the databases of a remote MySQL server within the phpMyAdmin interface. This article will walk through the process of adding an additional server to your phpMyAdmin interface.
Procedure
1. Log in to SSH as a root-level user
2. Make a copy of the default Roundcube's configuration file:
cp -av /usr/local/cpanel/base/3rdparty/phpMyAdmin/config.inc.php /usr/local/cpanel/base/3rdparty/phpMyAdmin/config.inc.php.orig
3. Open the configuration file with your favorite Text Editor (vim, vi, nano, etc)
4. Modify and add the following code to the bottom of the file:
$i++;
$cfg['Servers'][$i]['verbose'] = 'Remote Server';
$cfg['Servers'][$i]['auth_type'] = 'cpanel';
$cfg['Servers'][$i]['host'] = 'localhost';
$cfg['Servers'][$i]['port'] = '3306';
$cfg['Servers'][$i]['connect_type'] = 'tcp';
$cfg['Servers'][$i]['compress'] = false;
$cfg['Servers'][$i]['AllowNoPassword'] = false;
$cfg['Servers'][$i]['DisableIS'] = false;
5. Save the file
Once the process has been completed, when you open the phpMyAdmin interface, you should now see a drop-down menu for the server selection like the following:
Please note: This guide assumes that the remote MySQL server is also a cPanel server, once connected with will be required to log into the remote server to authorize the connection between servers. If the remote MySQL server is not a cPanel server, the above code will require further customizations.
For more on configuring an additional server within phpMyAdmin, please see their excellent documentation on this here:
https://docs.phpmyadmin.net/en/latest/config.html#server-connection-settings
Comments
0 comments
Article is closed for comments.