How to troubleshoot MySQL does not allow remote connection errors

Source: Internet
Author: User
Tags mysql command line

Recently using Navicat for MySQL access to the remote MySQL database, an error occurred, showing "1130-host ' xxx.xxx.xxx.xxx ' is not allowed to connect to this MySQL server".

The reason for the error is that the local IP (xxx.xxx.xxx.xxx) does not have permission to access the remote database .

The following enables local IP (xxx.xxx.xxx.xxx) access to the remote MySQL database.

The solution is as follows:

1, on the server side, open the cmd window, enter the MySQL installation directory bin, enter mysql-u root-p, and then enter the password after entering into the MySQL command line.

2, input use MySQL;

3. Enter select user,host from user;

You can see that there is only localhost in host. We need to add xxx.xxx.xxx.xxx to this.

4.

Add the following method:

Input

Grant all privileges on * * to [e-mail protected] "xxx.xxx.xxx.xxx" identified by "password";

This is equivalent to giving ip-xxx.xxx.xxx.xxx all the permissions, including remote access permissions.

And then enter

Flush privileges;

This is equivalent to reloading MySQL permissions, which must be there .

5. Re-enter select user,password,host from user;

You can see that the new IP has been added to the host.

6, again in the client with Navicat for MySQL access to the remote MySQL database, has been able to open the normal.

Reference Link: http://jingyan.baidu.com/article/b907e627b0e3b846e7891cc9.html

How to troubleshoot MySQL does not allow remote connection errors

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.