SQLyog client cannot connect to MySQL server

Source: Internet
Author: User

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

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.