当前位置:网站首页>MySQL foundation 07-dcl
MySQL foundation 07-dcl
2022-07-03 01:12:00 【Super brother 1986】
DCL sentence
DCL Statements are mainly DBA Used to manage object permissions in the system , Common developers rarely use . below
Let's briefly explain it with an example .
Create a database user plf, Have right plf Of all the tables in the database SELECT/INSERT jurisdiction :
1. Manage users
1. Add users :
* grammar :CREATE USER ' user name '@' Host name ' IDENTIFIED BY ' password ';
* The host name can be used % Indicates that the user can access the database from any address
2. Delete user :
* grammar :DROP USER ' user name '@' Host name ';
3. Change user password :
UPDATE USER SET PASSWORD = PASSWORD(' New password ') WHERE USER = ' user name ';
UPDATE USER SET PASSWORD = PASSWORD('abc') WHERE USER = 'lisi';
SET PASSWORD FOR ' user name '@' Host name ' = PASSWORD(' New password ');
SET PASSWORD FOR 'root'@'localhost' = PASSWORD('123');
* mysql I forgot root User's password ?
1. cmd -- > net stop mysql stop it mysql service
* The administrator is required to run the cmd
2. Start with no validation mysql service : mysqld --skip-grant-tables
3. Open up new cmd window , Direct input mysql command , Knock back . You can log in successfully
4. use mysql;
5. update user set password = password(' Your new password ') where user = 'root';
6. Close two windows
7. Open Task Manager , Manual end mysqld.exe The process of
8. start-up mysql service
9. Log in with the new password .
4. Query the user :
-- 1. Switch to mysql database
USE myql;
-- 2. Inquire about user surface
SELECT * FROM USER;
notes : wildcard : % Indicates that the user can log in to the database on any host
2. Rights management :
1. Query authority :
-- Query authority
SHOW GRANTS FOR ' user name '@' Host name ';
SHOW GRANTS FOR 'lisi'@'%';
2. Grant authority :
-- Grant authority
grant Permission list on Database name . Table name to ' user name '@' Host name ';
-- Give all permissions to Zhang San , On any table in any database
GRANT ALL ON *.* TO 'zhangsan'@'localhost';
3. Revoke authority :
-- Revoke authority :
revoke Permission list on Database name . Table name from ' user name '@' Host name ';
REVOKE UPDATE ON db3.`account` FROM 'lisi'@'%';
边栏推荐
- excel表格计算时间日期的差值,并转化为分钟数
- Esp32 simple speed message test of ros2 (limit frequency)
- 详解RDD基本概念、RDD五大属性
- MySQL
- Appuyez sur l'apprentissage de l'esprit de frappe - reconnaissance des coordonnées de fond multithreadées
- [flutter] icons component (load the built-in icon of flutter | display the material design icon completely)
- [case sharing] let the development of education in the new era advance with "number"
- How wide does the dual inline for bread board need?
- tail -f 、tail -F、tailf的区别
- Assets, vulnerabilities, threats and events of the four elements of safe operation
猜你喜欢

这不平凡的两年,感谢我们一直在一起!
![[AUTOSAR 11 communication related mechanism]](/img/bf/834b0fad3a3e5bd9c1be04ba150f98.png)
[AUTOSAR 11 communication related mechanism]

FPGA - 7 Series FPGA internal structure clocking -04- multi area clock

The difference between tail -f, tail -f and tail

飞凌搭载TI AM62x的ARM核心板/开发板首发上市,亮相Embedded World 2022

测试右移:线上质量监控 ELK 实战

【FPGA教程案例6】基于vivado核的双口RAM设计与实现

异步、邮件、定时三大任务

Find a benchmark comrade in arms | a million level real-time data platform, which can be used for free for life
![[AUTOSAR XIII NVM]](/img/38/805ab70f199e2cfad4d9dae0e2c1ff.png)
[AUTOSAR XIII NVM]
随机推荐
异步、郵件、定時三大任務
Leetcode-2115: find all the dishes that can be made from the given raw materials
(C语言)数据的存储
Compare version number
安全运营四要素之资产、脆弱性、威胁和事件
合并K个已排序的链表
1696C. Fishingprince Plays With Array【思维题 + 中间状态 + 优化存储】
1038 Recover the Smallest Number
Matlab finds the position of a row or column in the matrix
Win10 can't be installed in many ways Problems with NET3.5
12_微信小程序之微信视频号滚动自动播放视频效果实现
The R language uses the ctree function in the party package to build conditional inference decision trees, uses the plot function to visualize the trained conditional inference decision tree, and the
Esp32 simple speed message test of ros2 (limit frequency)
Button wizard play strange learning - go back to the city to buy medicine and add blood
Mongodb common commands of mongodb series
研发一款国产ARM智能边缘计算网关需要什么
Test shift right: Elk practice of online quality monitoring
瑞萨RZ/G2L 处理器简介|框架图|功耗|原理图及硬件设计指南
MySQL multi table joint deletion
tail -f 、tail -F、tailf的区别