【MySQL】解决java.sql.SQLException: null, message from server: “Host ‘xxx’ is not allowed to connect

The operation steps are as follows:

1. Login
The command line is as follows:

mysql -u root -p

2. Enter the original password and enter the password
according to the promptEnter password:

3. Execution

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

4. Execution

flush privileges;

5. Execution

use mysql;

6. Execution

select host,user from user;

insert image description here

The display %means that the modification has been completed, and the error has been resolved.

Guess you like

Origin blog.csdn.net/qq_44921056/article/details/131425992