Environment: The MySQL service is installed under CentOS using the Yum command
1. Enter Linux via command service mysqld start MySQL Services
2, using SQLyog connection MySQL found not connected, such as:
However, the database can be connected locally on Linux. So the network is no problem; through Netstat-nalp | grep "3306" command found 3306 ports also open;
Through the Ask Niang found the problem may be in the iptables, view the iptables running state, found that iptables is running, all through the chkconfig iptables off the firewall, through Chkconfig--list, view such as:
Then stop the running Firewall by command service iptables stop
Attention:
If you do not want to shut down the firewall you can also add a input-m state--state new-m tcp-p TCP--dport 3306-j ACCEPT to/etc/sysconfig/iptable by modifying the configuration file s (need to restart the Iptables service), which means 3306 ports are allowed through the firewall.
Log in here using SQLyog, or you will not be able to log in or prompt for an error message such as:
According to the error, my local host's network card IP remote connection is not allowed to connect to the MySQL server through the host, you can initially determine that may be due to lack of permissions;
We need to add permissions to the User:
Log in to MySQL and enter the following commands under MySQL:
GRANT All privileges on * * to ' root ' @ '% ' identified by ' 123456 ' with GRANT OPTION; Allow user root to connect to MySQL server from any host using password 123456
If you need to make a host, you can use the following command:
GRANT All privileges on * * to ' root ' @ ' 10.1.1.123 ' identified by ' 123456 ' with GRANT OPTION; Allows the user root to connect to the MySQL server from the IP-10.1.1.123 host and use 123456 as the login password
Once the authorization is successful, try the remote connection again, and you can find the connection is successful, such as:
Reference Documentation:
http://blog.itpub.net/31015730/viewspace-2143797/
SQLyog client cannot connect to MySQL server