MySQL remote connection: Error 1130 (hy000): Host '*. *' is not allowed to connect to this MySQL Ser

Source: Internet
Author: User

Mysql is used in the recording project. During the test today, we found that the mysql database cannot be remotely connected. It turns out that mysql does not allow remote connection by default.

After searching, we found a solution and recorded it for future reference.

 

(1) At first, I used the root user to remotely connect to the mysql server ip address and reported an error:

[root@chu Record]# mysql --host=192.168.110.68 --user=root --passwordEnter password: ERROR 2003 (HY000): Can't connect to MySQL server on '192.168.110.68' (111)

It turns out to be

By default, Mysql only allows local login, so you need to modify the configuration file to bind the address to comment out:
Vim/etc/mysql/my. cnf
# Instead of skip-networking the default is now to listen only on
# Localhost which is more compatible and is not less secure.
# Bind-address = 127.0.0.1 <--- comment out this line and you can log on remotely.

See http://blog.sina.com.cn/s/blog_60fcb5a10100qkyb.html

(2) continue to report the following errors after modification:

1  [root@chu Record]# mysql --host=192.168.110.68 --user=root --password
2 Enter password:
3 ERROR 1130 (HY000): Host '192.168.56.123' is not allowed to connect to this MySQL server

If you want to allow myuser to connect to the mysql server from a host whose ip address is 192.168.1.3, and use mypassword as the password
Grant all privileges on *. * TO 'myuser' @ '192. 168.1.3 'identified BY 'mypassword' with grant option;

See http://blog.csdn.net/rongjch/archive/2006/02/23/607124.aspx

 

After this operation, the problem is solved.

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.