1. mysql View user
Mysql> select User,host,password from Mysql.user;
2. mysql Password change
mysql> Update mysql.user set Password=password ("Anonymous") where user= "root" and host= " localhost "; (set new password)
mysql> flush privileges; (refresh)
3. mysql Grant remote login permission for root
GRANT all privileges on * * to ' root ' @ '% ' identified by ' MyPassword ' with GRANT OPTION;
4. View the storage type
Show varibales like ' storage_engine% ';
5. View the details of the new table
Mysql> Show CREATE TABLE it_salary;
6. View permission information for authorized users
Format:
Show grants for user name @ "Client Address";
Mysql> Show grants for [email protected] "192.168.4.%";
Command format:
Grant permission list on database name to user name;
Grant permission list on database name to user name; (the address specified can be linked)
Grant permission list on database name to username @ Client address identified by "password" (specified address, and enter password to link)
Grant permission list on database name to user name @ client address identified by "password" with GRANT option; (Authorized users can authorize other users)
Example:
Grant all on * * to [email protected];
Grant Select on userinfo.* to [e-mail protected] identified by ' 123456 ' with GRANT option;
Grant Select,insert,update (name) on Studb.t1 to Hydra;
7. Revoke User Rights
Format:
Revoke permissions list on database name from user @ "client address";
Instance:mysql> revoke insert on USERINFO.T1 from [email protected] "192.168.4.254";
Revoke User authorization rights: (You can revoke permissions only if you have explicitly authorized the library)
Format:
Revoke grant option on database name from user name @ "Client Address";
Example:mysql> revoke grant option on userinfo.* form [email protected] "192.168.4.254";
Revoke the specified permission:
Format: Revoke permissions list on database name from user name @ "Client Address";
Instance:mysql> revoke Delete on userinfo.* form [email protected] "192.168.4.254"; (Revoke delete permission)
MySQL authorization and revocation Authorization for remote users