Login
Mysql-uroot-p
See which databases are available
show databases;
Create a normal user sa with a password of Some_pass
CREATE USER ' sa ' @ '% ' identified by ' some_pass ';
Grant this user permission to Select,insert,update,delete remote access, which is typically used to provide system access to the implementation
GRANT select,insert,update,delete on * * to ' sa ' @ '% ';
Create an Admin user admin account, password is Some_pass
CREATE USER ' admin ' @ '% ' identified by ' some_pass ';
Grant all remote access permissions to this user. This user is mainly used to manage the entire database, backup, restore and other operations.
GRANT all on * * to ' admin ' @ '% ';
Make authorization effective immediately
Flush privileges;
View current status
Show status;
threads_connected Current number of connections, max_connections maximum number of connections
Clear MySQL Invalid connection number
Select Concat (' KILL ', id, '; ') from information_schema.processlist to outfile '/tmp/a.txt ';
Source/tmp/a.txt;
"Mysql" common commands