This article is a mirror article of machine translation, please click here to jump to the original article.

View: 12542|Reply: 0

[Solved] HOSt ip is not allowed to connect to this MySql server

[Copy link]
Posted on 7/18/2016 11:05:22 AM | | |
Error: 1130-host... is not allowed to connect to this MySql server

Workaround:

1。 Reform the voting system.

It may be that your account is not allowed to log in remotely, only on localhost. At this time, just log in to mysql on the localhost computer, change the "host" item in the "user" table in the "mysql" database, and change it from "localhost" to "%"

mysql -u root -pvmwaremysql>use mysql;

mysql>update user set host = '%' where user = 'root';

mysql>flush privileges;

mysql>select host, user from user;

mysql>quit

2. Authorization Law.

For example, if you want MyUser to connect to a MySQL server from any host using MyPassword.

GRANT ALL PRIVILEGES ON *.* TO 'myuser'@'%' IDENTIFIED BY 'mypassword' WITH GRANT OPTION;

FLUSH PRIVILEGES;

If you want to allow user myuser to connect to the mysql server from a host with IP 192.168.1.6 and use mypassword as the password

GRANT ALL PRIVILEGES ON *.* TO 'myuser'@'192.168.1.3' IDENTIFIED BY 'mypassword' WITH GRANT OPTION;

FLUSH PRIVILEGES;

If you want to allow the user MyUser to connect to the DK database of the MySQL server from a host with IP 192.168.1.6 and use MyPassword as the password

GRANT ALL PRIVILEGES ON dk.* TO 'myuser'@'192.168.1.3' IDENTIFIED BY 'mypassword' WITH GRANT OPTION;

FLUSH PRIVILEGES;

The first method I used, I just found that it didn't work, I looked it up on the Internet, and executed one less statement mysql>FLUSH RIVILEGES to make the modification take effect. That's it

Another method, but I haven't tried it myself, I found it on the csdn.net, you can take a look.

Run on a machine with mysql installed:

1. d:\mysql\bin\>mysql -h localhost -u root // This should allow you to enter the MySQL server


2. mysql>GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' WITH GRANT OPTION // Grant any host access to data


3. mysql>FLUSH PRIVILEGES // modification takes effect


4. EXIT > mysql // Exit the MySQL server

This allows you to log in as root on any other host!







Previous:MySQL 5.1.73 is an install-free version of x32 and x64-bit download
Next:.net websites read large files
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com