Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What is the common user and permission control of DCL in mysql

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

In this article Xiaobian for you to introduce in detail "what is the common user and access control of DCL in mysql", the content is detailed, the steps are clear, and the details are handled properly. I hope that this article "what is the common user and access control of DCL in mysql" can help you solve your doubts.

I. user control and management

Create a user

Create user 'username' @ 'hostname' identified by 'password'

Modify a user's password

Alter user 'username' @ 'hostname' identified with mysql_native_password by 'password'

Delete user

Drop user 'username' @ 'hostname'

For example:

# 1 query user use mysql;select * from user;#2 create user create user 'root'@'localhost' identified by' 123456 change user password alter user 'root'@'localhost' identified with mysql_native_password by' 1234 match 4 Delete user drop user 'root'@'localhost'

Note:

Localhost: indicates matching local host

%: indicates that any host can be matched

II. Authority control and management

Query permission

Show grants for 'user name' @ 'Host number'

Grant authority

Grant permission list on database name. Table name to 'username' @ 'host number'

Delete permission

Revoke permission list on database name. Table name from 'username' @ 'host number'

For example:

# query permission show grants for 'root'@'localhost';# grant permission grant all on test.* to' root'@'localhost';# delete permission revoke all on test.* from 'root'@'localhost'

Note:

All: can mean that full permissions are granted.

Test.*: * can indicate that it matches any data and can be used in both database and table names.

After reading this, the article "what are the common users and access controls of DCL in mysql" has been introduced. If you want to master the knowledge points of this article, you still need to practice and use it yourself. If you want to know more about related articles, you are welcome to follow the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report