I. Definition of user1.1 User name + host domain
Here is the 5.7.2 version of MySQL in which the password field has been changed to authentication_string
Mysql> select user,host,authentication_string from user;
+---------------+-----------+-------------------------------------------+| user | host | authentication_string |+---------------+-----------+-------------------------------------------+| root | localhost | *5B11E7BC48365F1019E05077EBDC42BA908B3342 || mysql.session | localhost | *THISISNOTAVALIDPASSWORDTHATCANBEUSEDHERE || mysql.sys | localhost | *THISISNOTAVALIDPASSWORDTHATCANBEUSEDHERE || shiqi | % | *5B11E7BC48365F1019E05077EBDC42BA908B3342 || shiqi | localhost | *5B11E7BC48365F1019E05077EBDC42BA908B3342 |+---------------+-----------+-------------------------------------------+5 rows in set (0.02 sec)
1.2 User Role
1.2.1 Login Database
The login command is: mysql -u username -p
then enter the password
1.2.2 managing databases and maintaining data
1.3 Connecting the database
Define User: User name + host domain, password
Define permissions: Define permissions (roles) on different objects
Command:
grant authority on target_zone to ‘user‘ identified by ‘password‘
Permission content (Authority):
Change and delete
Insert Update, select, delete, drop, create
Permissions |
Permission Levels |
Permission Description |
CREATE |
Database, table, or index |
Create database, table, or index permissions |
DROP |
Database or table |
Delete database or table permissions |
GRANT OPTION |
A database, table, or saved program |
Granting permission Options |
REFERENCES |
Database or table |
|
Alter |
Table |
Change tables, such as adding fields, indexes, etc. |
DELETE |
Table |
Delete Data permissions |
INDEX |
Table |
Index permissions |
INSERT |
Table |
Insert Permissions |
SELECT |
Table |
Query permissions |
UPDATE |
Table |
Update permissions |
SQL statements and 5.7.2 MySQL user management