To allow mysql to be remotely connected and used, we need to simply enable the mysql remote connection permission. Below I will introduce several solutions for MYSQL remote connection.
You need to create a remote account in MYSQL on the server. By default, the root remote login fails.
1. Create a Remote Account
The Code is as follows: |
Copy code |
Create user 'test' @ '192. 4.19.112 'identified by 'testpasswd '; # Only 223.4.19.112 allowed |
This IP login is allowed to be @ '%' 2. Set permissions
The Code is as follows: |
Copy code |
Grant all PRIVILEGES on zjhy. * to 'test' @ '2017. 4.19.112 '; |
3. Test it.
The Code is as follows: |
Copy code |
Mysql-h224.4.7.77-uzjhy-p |
4. The test is successful!
After the permission is set, you only need to configure phpmyadmin to connect to a remote MySQL database to manage the mysql database locally.
Introduction:
1. The phpmyadmin program is located on the server 192.168.1.1 with the access address http: // 192.168.1.1/phpmyadmin.
2. MySQL database server: 192.168.1.2, which already allows external database chains. MySQL database username: admin Password: 123456
3. Now we need to use http: // 192.168.1.1/phpmyadmin to manage the MySQL database above 192.168.1.2.
System O & M reminder: qihang01 original content is copyrighted. For more information, see the source and original article links.
The procedure is as follows:
1. Download phpmyadmin to the http: // 192.168.1.1/phpmyadmin directory
:, Find the version you need
For example:
2. Modify the config. default. php file in the libraries folder in the phpmyadmin directory.
1. Find $ cfg ['pmaabsoluteuri '] and set the value to http: // 192.168.1.1/phpmyadmin.
2. Search for $ cfg ['servers'] [$ I] ['host'] and set its value to 192.168.1.2.
3. Search for $ cfg ['servers'] [$ I] ['user'] and set the value to admin.
4. Search for $ cfg ['servers'] [$ I] ['Password'] and set the value to 123456.
3. After the configuration is complete, enter the database username: admin Password: 123456 through http: // 192.168.1.1/phpmyadmin to access the MySQL database above 192.168.1.2.