当前位置:网站首页>MySQL Architecture - user rights and management
MySQL Architecture - user rights and management
2022-07-04 22:38:00 【swttws.】
Catalog
2、 Understanding users user surface
3、 ... and 、 The remote access
1、 Grant users remote connection permission
2、 First ping Let's look at the database IP Address
One 、MYSQL User management
1、 Create user
create user lisi identified by '123456';
Indicates that the creation user name is lisi, The password for 123456 Users of
2、 Understanding users user surface
Query specific fields of user table
select host,user,authentication_string,select_priv,insert_priv,drop_priv from mysql.user;
(1)host Indicates the connection type
①% Represents a remote connection , Other machines can pass through the IP Address to connect ;
②localhost Indicates a local connection , Such as mysql -u root -p;
(2)user Represents the user name , Different connection methods and permissions of the same user
(3)select_priv , insert_priv by · User permissions
3、 Change user password
(1) Change the current user password
set password =password('123456')
(2) Change a user password , You have to use root The user to change
update mysql.user set authentication_string=password('111111') where user='lisi';
After modifying the user table , The following instructions need to be executed to take effect
flush privileges;
4、 Delete user
drop user 'lisi';
notes : Do not use the following statement to delete , There will be residual information in the system
delete from user where user='lisi'
Two 、 Rights management
1、 Authorization command
The authorization order needs to be in root Execute under the user
grant jurisdiction 1, jurisdiction 2,..., jurisdiction n on Database name . Table name to user name @ Address of the user identified by User password
Such as :
grant select,insert,delete,update on mytabl.* to [email protected] identified by ‘123456
This command is given to lisi grant mytabl Permissions for adding, deleting, modifying and querying all tables under the database , user lisi Must save
2、 Take back authority
The revoke permission command needs to be in root Execute under the user
revoke jurisdiction 1, jurisdiction 2,..., jurisdiction n on Database name . Table name to user name @ Address of the user
Such as :
REVOKE select,insert,update,delete ON *.* FROM [email protected]'%';
Retract in lisi Under the user , Operate the addition, deletion, modification and query commands of all tables , After executing the instruction , need lisi Re login is effective
3、 View permissions
(1)show grants: View current user permissions ;
(2) View the global permissions of a user :
select * from mysql.user
3、 ... and 、 The remote access
1、 Grant users remote connection permission
grant all privileges on *.* to user @'%' identified by ' password ';
2、 First ping Let's look at the database IP Address
ping The machine where the database is located IP Address -t
3、 Firewall settings
(1) Turn off firewall
systemctl stop firewalld.service
(2) Or open ports
firewall-cmd --add-port=3306/tcp --permanent # service iptables restart firewall-cmd --reload
4、 Test connection
边栏推荐
- Flask 上下文详解
- 共创软硬件协同生态:Graphcore IPU与百度飞桨的“联合提交”亮相MLPerf
- Close system call analysis - Performance Optimization
- How to reset the password of MySQL root account
- Interview essential leetcode linked list algorithm question summary, whole process dry goods!
- Shell 脚本实现应用服务日志入库 Mysql
- High school physics: linear motion
- 短视频系统源码,点击屏幕空白处键盘不自动收起
- Apachecn translation, proofreading, note sorting activity progress announcement 2022.7
- Business is too busy. Is there really no reason to have time for automation?
猜你喜欢
The Sandbox 和数字好莱坞达成合作,通过人力资源开发加速创作者经济的发展
【OpenGL】笔记二十九、抗锯齿(MSAA)
Redis sentinel simply looks at the trade-offs between distributed high availability and consistency
MYSQL架构——用户权限与管理
Locust performance test - environment construction and use
Lost in the lock world of MySQL
LOGO特训营 第五节 字体结构与设计常用技法
Logo Camp d'entraînement section 3 techniques créatives initiales
都说软件测试很简单有手就行,但为何仍有这么多劝退的?
Introduction and application of bigfilter global transaction anti duplication component
随机推荐
Éducation à la transmission du savoir | Comment passer à un test logiciel pour l'un des postes les mieux rémunérés sur Internet? (joindre la Feuille de route pour l'apprentissage des tests logiciels)
[acwing] solution of the 58th weekly match
BigFilter全局交易防重组件的介绍与应用
现在mysql cdc2.1版本在解析值为0000-00-00 00:00:00的datetime类
30余家机构联合发起数字藏品行业倡议,未来会如何前进?
La prospérité est épuisée, les choses sont bonnes et mauvaises: Où puis - je aller pour un chef de station personnel?
Logo special training camp section II collocation relationship between words and graphics
[the 2023 autumn recruitment of MIHA tour] open [the only exclusive internal push code of school recruitment eytuc]
[cooking record] - stir fried 1000 pieces of green pepper
Force buckle 2_ 1480. Dynamic sum of one-dimensional array
攻防世界 misc 进阶区 2017_Dating_in_Singapore
达梦数据凭什么被称为国产数据库“第一股”?
PostgreSQL服务端编程聚合和分组
【lua】int64的支持
Practice and principle of PostgreSQL join
攻防世界 MISC 进阶区 hong
UML图记忆技巧
特征缩放 标准化 归一化
LOGO特训营 第四节 字体设计的重要性
Tla+ introductory tutorial (1): introduction to formal methods