Detailed questions about remote connection to Mysql database (ERROR 2003 (HY000)) _mysql

Source: Internet
Author: User

When we use the client and its remote connection to the server MySQL database, the following problems are easy to appear:
Problem Code Code
ERROR 2003 (HY000): Can ' t connect to MySQL server on ' 192.168.0.19 ' (111)
ERROR 2003 (HY000): Can ' t connect to MySQL server on ' 192.168.0.19 ' (111) The reason is the MySQL database default profile my.cnf (Linux) bind- Address defaults to 127.0.0.1, so even if you create a remote access user, you can not use the mysql-h command to access, if the access will have problems, because at this time MySQL only accept localhost, So we need to shield the bind-address off.

MY.CNF is generally under/etc/mysql, if the locate MY.CNF lookup is not used, the MY.CNF profile before the modification is:

Pre-Modified MY.CNF profile code

# Instead of skip-networking The default is now to listen only On&nbs P
# localhost which are more compatible and are not less secure. 
Bind-address     &nbs p;     = 127.0.0.1 
#
# Instead of skip-networking The default is now to listen only ON
# localhost which are more compatible and are not less secure.
bind-address           = 127.0.0.1
All we need to do is block this bind-address code, and the code behind the mask is:

MY.CNF configuration file code after shielding
#
# Instead of skip-networking The default is now to listen only
# localhost which are more compatible and are not less secure.
#bind-address = 127.0.0.1
#
# Instead of skip-networking The default is now to listen only
# localhost which are more compatible and are not less secure.
#bind-address = 127.0.0.1
Now you can use the mysql-h command to do what you want, such as the login system:

Log in to the database code
Mysql-h 192.168.0.19-u Root-p

Related Article

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.