Method 1. log on to mysql locally, change the "host" item in the "user" table in the "mysql" database, and change "localhost" to "%"
# Mysql-u root-proot
Mysql> use mysql;
Mysql> update user set host = '%' where user = 'root ';
Mysql> select host, user from user;
Method 2: direct authorization (recommended)
Use the root user on any host, password: youpassword (your root password) to connect to the mysql server:
# Mysql-u root-proot
Mysql> grant all privileges on *. * TO 'root' @ '%' identified by 'youpassword' with grant option;
Allow the address 202.11.10.253 to connect to all mysql databases with the root user and password dboomysql, and grant the select, insert, update, and delete permissions.
# Mysql-u root-proot
Grant select, insert, update, delete on *. * to root @ "202.11.10.253" Identified by "dboomysql ";
Allow the address 202.11.10.253 to use the root user and password dboomysql to connect to all mysql Databases and grant all permissions.
# Mysql-u root-proot
Grant all on *. * to root @ "202.11.10.253" Identified by "dboomysql"
After the operation, remember to execute the following command to refresh the permission.
FLUSH PRIVILEGES