1, the right to give
Description: MySQL deployed on server A, internal network Host B through the client tools to connect server A for database operations, requires server A to give Host B operation MySQL permissions
1.1 Enter MySQL on Server A, assuming that the MySQL account on server A is root:
Copy Code code as follows:
Then enter the password!
1.2 Grant Host B the ability to operate the database
Copy Code code as follows:
Mysql> grant usage on *.* to username@192.168.0.1 identified by ' password ';
Description: Give username@192.168.0.1 the right to use all databases, login on host 192.168.0.1 using username account, password: password
Copy Code code as follows:
Mysql> grant all privileges in newdb.* to username@192.168.0.1;
Description: Give username@192.168.0.1 operation database newdb the highest authority, on the host 192.168.0.1 use username account login, no password
Example:
Copy Code code as follows:
Mysql> grant all privileges in *.* to root@192.168.0.1 identified by ' 123456 ';
Description: Give root@192.168.0.1 the right to use all databases, login with root account on host 192.168.0.1, password: 123456
2. Remove account number
Copy Code code as follows:
mysql> drop user root@192.168.0.1;
Note: Remove account root so that the host 192.168.0.1 can no longer use the database on Server A with the root user operation