The following describes how to connect phpmyadmin to a remote mysql database. For more information, see.
The following describes how to connect phpmyadmin to a remote mysql database. For more information, see.
Modify the phpmyadminconfig. inc. php file in the phpmyadmin site of the Local Machine
Find this line and change the 'localhost' after ['host'] to the remote database IP address.
The Code is as follows: |
|
$ Cfg ['servers'] [$ I] ['host'] = '2017. 168.1.10 '; |
Note: 192.168.1.10 is the IP address of the remote database.
After modification, --- start Menu ---- run ---- cmd (Press ENTER) ---- net stop mysql (Press ENTER) -------- net start mysql (Press ENTER)
This proves that your phpmyadmin can be remotely connected, but it is useless for mysql to not support remote connection. The following describes how to enable remote connection in mysql.
First, connect to the local mysql (log on to the terminal using ssh and enter the following command ):
After logging in to mysql-uroot-p, enter the password and run the following statement.
The Code is as follows: |
|
Grant all privileges on *. * to 'user' @ '%' identified by 'Password' with grant option; |
Here, user is the user name, mysql is the root by default, and password is set by yourself. % Indicates any host. This allows remote access from any host.
Done: When you access the phpmyadmin site on the local machine, the user name and password entered are the remote database, and you can directly connect to the database.