Refresh mysql permission connection under linux

解决问题:java.sql.SQLException: null,  message from server: "Host '0.0.0.0' is not allowed to connect to this MySQL server"

 

1. When the server is turned on, enter the mysql database command: mysql -u root -p

2. Use the mysql library command: use mysql;

3. View the user table Command: SELECT `Host`,`User` FROM user;

4. Update user list UPDATE user SET `Host` = '%' WHERE User = 'root' LIMIT 1;

5. Force refresh privilege command: flush privileges;

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324890861&siteId=291194637