MySQL common commands and SQL statements

User related:
//Create aaa user (host% represents any ip client), and authorize all permissions of all tables in the test library, the password is 123
mysql> grant all privileges on test.* to 'aaa'@'%' identified by '123';

//Refresh authorization to take effect
mysql> flush privileges;

//Query all mysql users
mysql> select user,host,password from mysql.user;
+------+-----------+-------------------------------------------+
| user | host      | password                                  |
+------+-----------+-------------------------------------------+
| root | localhost | *FAAFFE644E901CFAFAEC7562415E5FAEC243B8B2 |
| root | 127.0.0.1 | *FAAFFE644E901CFAFAEC7562415E5FAEC243B8B2 |
+------+-----------+-------------------------------------------+
2 rows in set (0.00 sec)






Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326866370&siteId=291194637