Treatment scenarios:
1, first connect to the MySQL database with localhost, and then use MySQL's own database MySQL;
Use MySQL;
2. Execution: Select host from user where user = ' root '; found that the value of host is localhost.
So get rid of its value: Update user set host= '% ' where user = ' root ';
3, after the completion of the modification, implementation: flush privileges;
When the modifications are in effect, they can be connected to the MySQL database properly with the IP address or localhost when they are configured again.
The operation is as follows:
mysql> use MySQL
Reading table information for completion of table and column names
Can turn off this feature to get a quicker startup with-a
Database changed
Mysql> Select host from user where user = ' root ';
+-----------+
| Host |
+-----------+
| localhost |
+-----------+
1 row in Set (0.00 sec)
mysql> Update user set host= '% ' where user = ' root ';
Query OK, 1 row Affected (0.00 sec)
Rows matched:1 changed:1 warnings:0
Mysql> Select host from user where user = ' root ';
+------+
| Host |
+------+
| % |
+------+
1 row in Set (0.00 sec)
mysql> flush Privileges;
Query OK, 0 rows Affected (0.00 sec)
Mysql>
Connect to MySQL times: Message from server: "Host ' 192.168.76.89 ' isn't allowed to connect to this MySQL server