MySQL cannot link remote, reported (Host ' ***.***.***.*** ' is not allowed to connect to this MySQL server)

Source: Internet
Author: User
Tags mysql command line

Host ' ***.***.***.*** ' isn't allowed to connect to this MySQL server

WHERE * * * ... is the local public network IP;

Workaround:

  1. Reading the wrong window first.

  2. The error is due to the fact 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.

  3. First, the remote connection enters the server, enters the mysql-u root-pin the CMS, then returns, enters the password, enters the MySQL command line.

  4. Input use MySQL;

  5. Enter select user,password,host from user;

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

  6. 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 .

  7. Re-enter select User,password,host from user;

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

  8. Now again with Navicat for MySQL access to the remote MySQL database, has been able to open the normal.

    Problem solving.

  9. However, there is another problem, found that the double-click to open a table is very slow, at least 3 seconds.

    The reasons are:

    When MySQL is accessed remotely, MySQL resolves the domain name, which results in slow access, 2, 3 seconds delay!

    Workaround:

    Modify the My.ini in the MySQL installation directory, and add the following configuration to resolve this issue. Join under [mysqld]:skip-name-resolve

    Save to restart the MySQL service after exiting.

    Then the access speed is as fast as the local.

MySQL cannot link to remote, reported (Host ' ***.***.***.*** ' is not allowed to connect to this MySQL server)

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.