How to connect phpmyadmin to a remote mysql database

Source: Internet
Author: User
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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.