Problem: MySQL permissions are set correctly, but still cannot be accessed remotely. 3306 Port is not open by Telnet.
Analysis: MySQL only binds 127.0.0.1 by default, that is, only the local computer can access port 3306.
Workaround: Locate the MySQL configuration file, search for "bind-address", and find this line:
bind-address = 127.0.0.1 in front add a #, comment out this line, save, restart MySQL. Remote access is available, and Telnet can discover that the port is also open.
Example we configure
1. Ensure that skip-networking is removed or blocked, otherwise TCP/IP access is not supported
2. Add line bind-address = 65.55.55.2, replace 65.55.55.2 as your server address
Save and close the configuration file
Restart MySQL server: #/etc/init.d/mysql restart
1. Change the table method.
It may be that your account is not allowed to log on remotely, only on localhost. This time, as long as the computer on the localhost, log in to MySQL, change the "MySQL" Database in the "User" table "host", from "localhost" to "%"
Code:mysql-u root-p123mysql>use mysql;mysql>update User Set host = '% ' where user = ' root '; Mysql>select host, U Ser from user;
2. Authorization law.
For example, if you want Kevin to use MyPassword to connect to a MySQL server from any host.
GRANT all privileges on * * to ' kevin ' @ '% ' identified by ' MyPassword ' with GRANT OPTION;
if you want to allow the user Kevin to connect to the MySQL server from the IP-192.168.101.234 host and use MyPassword as the password
GRANT all privileges on * * to ' kevin ' @ ' 192.168.101.234 ' identified by ' MyPassword ' with GRANT OPTION;
Note that it's important to have a Linux system firewall, too.
Iptables-i input-p TCP--dport 3306-j ACCEPT
More content:
MySQL remote database imported to local
MySQL command line export database
MySQL Forgot password solution
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
MySQL sets multiple ways to remotely access a database