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 set host = ‘%‘ 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 -p mysql> select user,host,password from mysql.user; mysql>drop user ‘‘ @localhost; mysql>update mysql.user set password = PASSWORD( ‘*********‘ ) where user= ‘root‘ ; mysql>flush privileges; |
The execution process is as follows:
Unable to remotely access MySQL solution