当前位置:网站首页>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 passwordSuch as :
grant select,insert,delete,update on mytabl.* to [email protected] identified by ‘123456This 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 userSuch 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 -t3、 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

边栏推荐
- Sqlserver encrypts and decrypts data
- 业务太忙,真的是没时间搞自动化理由吗?
- Logo special training camp Section V font structure and common design techniques
- Recommendation of mobile app for making barcode
- 2022-07-04:以下go语言代码输出什么?A:true;B:false;C:编译错误。 package main import “fmt“ func main() { fmt.Pri
- [Yugong series] go teaching course 003-ide installation and basic use in July 2022
- LOGO特训营 第五节 字体结构与设计常用技法
- TLA+ 入门教程(1):形式化方法简介
- ACM multimedia 2022 | counterfactual measurement and elimination of social prejudice in visual language pre training model
- LOGO特訓營 第三節 首字母創意手法
猜你喜欢

Convolutional neural network model -- lenet network structure and code implementation

Locust性能测试 —— 环境搭建及使用

MYSQL架构——逻辑架构

Huawei Nova 10 series released Huawei application market to build a solid application security firewall

攻防世界 MISC 進階區 Erik-Baleog-and-Olaf

攻防世界 MISC 高手进阶区 001 normal_png

LOGO特訓營 第三節 首字母創意手法

质量体系建设之路的分分合合

2022-07-04: what is the output of the following go language code? A:true; B:false; C: Compilation error. package main import “fmt“ func main() { fmt.Pri

Energy momentum: how to achieve carbon neutralization in the power industry?
随机推荐
攻防世界 MISC 进阶区 hit-the-core
Locust performance test - environment construction and use
攻防世界 MISC 进阶区 Erik-Baleog-and-Olaf
[acwing] solution of the 58th weekly match
通过Go语言创建CA与签发证书
LOGO特训营 第三节 首字母创意手法
Deployment of JVM sandbox repeater
攻防世界 misc 进阶区 2017_Dating_in_Singapore
Force buckle_ Palindrome number
PostgreSQL server programming aggregation and grouping
Logo special training camp Section IV importance of font design
环境加密技术解析
High school physics: linear motion
Mongodb aggregation operation summary
Google Earth Engine(GEE)——Tasks升级,实现RUN ALL可以一键下载任务类型中的所有影像
Wake up day, how do I step by step towards the road of software testing
LOGO特训营 第五节 字体结构与设计常用技法
将QA引入软件开发生命周期是工程师要遵循的最佳实践
模拟摇杆控制舵机
质量体系建设之路的分分合合
