Solution: 1. Change the table. It may be that your account is not allowed to log on remotely, but only on localhost. At this time, you only need to log in to mysql on the computer of localhost, and change the host item in the user table in mysql database from localhost to % mysql-uroot-pvmwaremysqlusemysql; mysqlupdateuserset
Solution: 1. Change the table. It may be that your account is not allowed to log on remotely, but only on localhost. At this time, you only need to log in to mysql on the computer of localhost, and change the host item in the user table in mysql database from localhost to % mysql-u root-pvmwaremysqluse mysql; mysqlupdate user set
Solution:
1. Change the table.
It may be that your account is not allowed to log on remotely, but only on localhost. At this time, you only need to log in to mysql on the computer of localhost, and change the "host" entry in the "user" table in the "mysql" database to "%" from "localhost"
Mysql-u root-pvmwaremysql> use mysql;
Mysql> update user set host = '%' where user = 'root ';
Mysql> select host, user from user;
2. Authorization method.
For example, if you want myuser to use mypassword to connect to the mysql server from any host.
Grant all privileges on *. * TO 'myuser' @ '%' identified by 'mypassword' with grant option;
Flush privileges; // The modification takes effect.
If you want to allow myuser to connect to the mysql server from a host whose ip address is 192.168.1.3, and use mypassword as the password
Grant all privileges on *. * TO 'myuser' @ '192. 168.1.3 'identified BY 'mypassword' with grant option;
Flush privileges; // The modification takes effect.
If you want to allow the user myuser to connect to the dk database of the mysql server from the host whose ip address is 192.168.1.3, 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 modification takes effect.
In this way, you can log on to any other host as the root user!