Home > Database > Mysql Tutorial > Mysql data control language

Mysql data control language

黄舟
Release: 2017-08-09 15:06:09
Original
1716 people have browsed it

Mysql data control language

1. Data control language

User management:

Storage location of user information:

Users in mysql are stored in the system database "mysql" of the mysql system.

Mysql data control language


##2. Create user:

create user 'Username'@'Location allowed to log in' identified by 'Password'

Example:

Mysql data control language


3. Delete user:

drop user ' Username '@' Allowed login location';

Modify user password:

Modify own password:

set  password  = password(‘新密码’);
Copy after login

Modify other people's passwords (with permission) :


set  password  for  ‘用户名’@’允许登录的位置’  = password(‘新密码’);
Copy after login


4. Permission management:

What are permissions?

Permission is the right to do something, such as "insert", create, update, and delete. . . .

"all" means "all permissions"

In fact, in the mysql system, permissions are the above-mentioned "words";

What permissions are there?

Mysql data control language

5. Refined to:

Mysql data control language


##6. Grant user permissions

grant permission 1, permission 2, .... on a certain library. A subordinate unit to ' User name '@' allows login location' [identified by 'password']

Description:

1, permission names include: insert, update, select, delete, create, drop. .....

2, "A certain subordinate unit" refers to the subordinate data elements in a library. Currently we have only learned 2: table, view;

For example: php44. The student table or php44.int_test

has two special writing methods:

*.*: indicates all subordinate units in all databases;

a certain library.*: indicates the All subordinate units in the database

3. If permissions are granted to existing users, the identified part can be omitted. If not omitted, it means changing their password;

And for a new user (That is, 'username'@'location where login is allowed' does not actually exist yet), the identified part cannot be omitted, and the grant statement actually creates a new user!

Mysql data control language##7. You can also grant "all permissions":

grant all privileges on php44.* to 'user1'@'192.168.44.64';
Copy after login
Cancel user permissions

revoke Permission 1, Permission 2, .... on a library. A subordinate unit from 'Username'@'Location where login is allowed'

Description:

1 Each item The meaning is the same as the grant statement;

2 means to cancel certain permissions of a certain user on a certain data unit.

The above is the detailed content of Mysql data control language. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template