MySQL---Data Control language (users and their rights management)

Source: Internet
Author: User

Where the user manages user data:

All users in MySQL are stored in the user table in the system database (MySQL)--regardless of which database users are stored here.

The initial contents of the table are as follows:

To create a user:

Form:

Create user ' username ' @ ' Allow login address/server ' identified by ' password ';

Description

1, allow the login address/server is, allow the location of the setting, to use the user name and password to login, other locations do not;

2, visible, MySQL security authentication, requires 3 information.

Example:

To view the user table in MySQL:

To delete a user:

Drop user ' username ' @ ' Allow login address or server name ';

To modify a user password:

To modify your password:

Set Password = password (' password ');

Modify someone else's password (provided that you have permission):

set password for ' username ' @ ' Allow login address ' = password (' password ');

What are Rights Management permissions?

MySQL database, all of the things that can be done, divided into more than 30 permissions, each of which is a "word"! Like what:

Select: The representative can query the data;

Update: The representative can modify the data;

Delete: representative can delete data;

.......

Where there is a permission called "all": means all permissions;

Have the following permissions:

Another form of presentation (with Chinese description):

To grant permissions:

Form:

Grant permission list on a library. An object to ' username ' @ ' Allow login location ' "Identified by ' password ';

Description

1, the permission list, that is, multiple permissions of the nouns, with each other separated by commas, such as: SELECT, INSERT, update

You can also write: all

2, a library. An object that is assigned to a "subordinate unit" in a specified database;

Subordinate units are: Table name, view name, stored procedure name, storage function name;

Of these, there are 2 special grammars:

*. *: Represents all sub-units in all databases;

A library. *: Represents all sub-units in the specified library;

3, "identified by ' password '" is to omit the part, if not omitted, it means the right to empower the same time, also to modify its password;

However: if the user does not store it, it is actually creating a new user, and the password must be set at this time.

Deprivation of authority:

Form:

Revoke permission list on a library. An object from ' User name ' @ ' Allow login location '

The meaning is exactly the same as in Grant;

MySQL---Data Control language (users and their rights 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.