In Linux, MySQLError1130 cannot be remotely accessed.

Source: Internet
Author: User
Recently I used MySQL databases for Linux projects, but when I remotely connect to MySQL, I always reported erro2003: Can

I recently used MySQL databases for Linux projects. However, when I remotely connect to MySQL, the error "erro 2003: Can" is always reported.

I recently used MySQL databases for Linux projects, but when I remotely connect to MySQL, I always reported erro 2003: Can't connect to MySQL server on '100. 87. ***. * ** '(111). The solution was found several hours yesterday, as shown below:

1. sudo gedit/etc/mysql. my. cnf

Find bind-address = 127.0.0.1

Change to bind-address = 0.0.0.0

2. sudo/etc/init. d/mysql restart

In this case, if you try a remote connection again, ERROR 1130 (HY000): Host '123456. 87. ***. *** 'is not allowed to connect to this MySQL server prompts that the database cannot be remotely connected.

Run the following command on the MySQL host:

Mysql-u root-ppassword // enter the mysql Console

Mysql> use mysql;

Mysql> update user set host = '%' where user = 'root'; // you can skip this error when executing this command.

Mysql> flush privileges;

Mysql> select host, user from user; // check whether '%' is inserted into the database

Mysql> quit

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.