MySQL local can connect, remote connection not on the resolution

Source: Internet
Author: User

1. Cause analysis

MySQL server is installed on the server. After the service is started, the Mysql-u user name-p password can be connected normally, but not on the other machines.

There are two possible reasons for this problem:

    • After MySQL is installed, the default is only open to 127.0.0.1 's native, not to the remote host.

Workaround:

(1) Find the default MySQL configuration file, usually/etc/mysql/my.cnf or/etc/my.conf

(2) Find bind-address= This option, modify to Bind-address = 0.0.0.0 (or modify the corresponding open IP address according to your own security requirements)

(3) Restart MySQL server (/etc/init.d/mysql stop/etc/init.d/mysql start)

    • The user's permissions are configured correctly, the user does not have permission to telnet to the MySQL server

Solutions and correlation analysis See: http://www.cnblogs.com/wonder315/archive/2011/11/02/2233010.html

When you refer to this tutorial, there are some problems:

(1) When the method is used to change the table method, this situation occurs

ERROR 1062 (23000): Duplicate entry '%-root ' for key ' PRIMARY '

The reason is that there are multiple records in the root user and therefore fail.

(2) The second method, the authorization law, is thus used. It's done soon, and there's no problem. It is recommended to use this method

MySQL local can connect, remote connection not on the resolution

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.