Connect Remote MySQL in local phpMyadmin
Today i will show you how to connect remotely installed mysql server in locally installed phpMyadmin. This is very easy to connect remote mysql server. It will help developer to save there time and effort of installing phpmyadmin on each server. They will now install phpmyadmin on there local workstation and can connect any number of mysql server in same phpmyadmin. It is easy to mange large number of database server at a single place. So, Lets get started..
Step 1: Firstly get the host ip address, username and password of remote MySQL server.
Read Also: How to install mariadb on centos 7
Step 2: Then go to the configuration file of phpmyadmin located in /etc/phpMyadmin/config.inc.php:
Step 3: Add the following Lines before “End of server Configuration”
$cfg['Servers'][$i]['host'] = '';
$cfg['Servers'][$i]['port'] = '';
$cfg['Servers'][$i]['socket'] = '';
$cfg['Servers'][$i]['connect_type'] = 'tcp';
$cfg['Servers'][$i]['extension'] = 'mysql';
$cfg['Servers'][$i]['compress'] = FALSE;
$cfg['Servers'][$i]['auth_type'] = 'config';
$cfg['Servers'][$i]['user'] = 'username';
$cfg['Servers'][$i]['password'] = 'password';
See picture for your reference.
Put your ip address in the host field
Put port number of your mysql server
Replace username and password with yours.
Step 4: Now restart the Services of apache:
service httpd restart (For centos 6)
systemctl restart httpd (For Centos/redhat 7)
Step 5: Now go to your web Browser and type:
Now you will see change in the login page there you will get drop down list and there you will find two host one is localhost and another is remote host which you had added in /etc/phpMyadmin/config.inc.php, login into remote mysql server with remote username and passsword as shown in picture:
Now you are connected the remote mysql-server in local phpmyadmin..
Now you can use remote mysql-server in locally installed phpmyadmin.
If you have any issue using this tutorial feel free to comment below..
Read Also: How to install postgresql on centos 7
Leave a Reply