This article describes how to use the mysqlroot user remote logon command and various remote methods. For more information, see.
This article describes how to use the mysql root User remote logon command and various methods to start remote logon. For more information, see.
Use the root user, password: youpassword (your root password), to connect to the server from any host:
# 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 use the root user and password dboomysql to connect to all mysql instances, and Grant, 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
Now let's look at the logon method.
The Code is as follows: |
|
Mysql-u root-pvmwaremysql> use mysql; Mysql> update user set host = '%' where user = 'root '; Mysql> select host, user from user; |
Run the following command on the machine where mysql is installed:
1. d: mysqlbin> mysql-h localhost-u root
// You can access the MySQL server.
2. mysql> grant all privileges on *. * TO 'root' @ '%' WITH GRANT OPTION
// Grant data access permissions to any host
3. mysql> FLUSH PRIVILEGES
// The modification takes effect.
4. mysql> EXIT
// Exit the MySQL server
In this way, you can log on to any other host as the root user.
Connect to MYSQL on the remote host
Assume that the IP address of the remote host is 110.110.110.110, the user name is root, and the password is abcd123. Enter the following command:
Mysql-h110.110.110.110-uroot-pabcd123 // remote Logon
(Note: you do not need to add spaces for u and root. The same applies to others)
3. exit MYSQL command: exit (Press ENTER)