Unable to remotely access MySQL solution

Source: Internet
Author: User

Now in a lot of internet companies for MySQL database use is an unstoppable trend, so often we do at the beginning of the project is to find a Linux server, to install a MySQL, and then at the beginning of our data table import work, But we can not always occupy the remote connection of the server Ah, so often we use Remote Tools to do database processing, but we also encounter the following conditions:

1 MYSQL CONNECT ERROR – 1130:Host ’202.43.**.**’ is not allowed to connect to this MySQL server”

The root cause of the above reject connection is because the connection account is limited to telnet when the MySQL account is created, which means that other IP (hosts) are not allowed except for the installation server where MySQL is currently located, even though your username and password are correct In fact, not MySQL default does not support remote, is the default user root of MySQL is not supported by default remote, plainly, that is, the permissions problem, the root user's host default is 127.0.0.1 (localhost) The simplest way is to re-build a user, Support remote access, not to modify root permissions, it is recommended to do so, but if you really need to take root remote operation is not no way, there are two options to solve:

① in the/ETC/MYSQL/MY.CNF [mysqld] segment commented out bind-address = 127.0.0.1

② log in with Mysql-uroot-p MySQL, and then use the following methods to open remote access permissions;

12345 #mysql -u root -p#*******(密码,默认的密码是空)mysql>use mysql;mysql>update user sethost = ‘%‘where user = ‘root‘;mysql>flush privileges;

After we execute the code we can see that the host of our root user is%, which means that all IP connections are allowed, such as:

Because in the above explanation process I found for some MySQL users for MySQL default password is empty this is not very concerned about, so here to everyone to give a reminder is just installed MySQL, after we install the end remember to clear empty users and timely change password, the following simple record these two processes , simple as follows:

Source: MySQL Database release version knowledge explained  http://www.gooln.com/video/2211.html

12345 mysql -u root -pmysql>selectuser,host,password from mysql.user;mysql>drop user ‘‘@localhost;mysql>update mysql.user setpassword = PASSWORD(‘*********‘) where user=‘root‘;mysql>flush privileges;

The execution process is as follows:

Unable to remotely access MySQL solution

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.