SQL statements and 5.7.2 MySQL user management

Source: Internet
Author: User
Tags mysql in create database

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.