当前位置:网站首页>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
边栏推荐
- 环境加密技术解析
- UML diagram memory skills
- 国产数据库乱象
- How can the advertising system of large factories be upgraded without the presence of large models
- Google Earth Engine(GEE)——以MODIS/006/MCD19A2为例批量下载逐天AOD数据逐天的均值、最大值、最小值、标准差、方差统计分析和CSV下载(北京市各区为例)
- Detailed explanation of flask context
- Practice and principle of PostgreSQL join
- 制作条形码的手机App推荐
- 醒悟的日子,我是怎么一步一步走向软件测试的道路
- Ascendex launched Walken (WLKN) - an excellent and leading "walk to earn" game
猜你喜欢
Nat. Commun.| Machine learning jointly optimizes the affinity and specificity of mutagenic therapeutic antibodies
[acwing] solution of the 58th weekly match
More than 30 institutions jointly launched the digital collection industry initiative. How will it move forward in the future?
Logo special training camp section III initial creative techniques
LOGO特训营 第三节 首字母创意手法
Li Kou 98: verify binary search tree
Breakpoint debugging under vs2019 c release
UML diagram memory skills
LOGO特訓營 第三節 首字母創意手法
Domestic database chaos
随机推荐
2022-07-04:以下go语言代码输出什么?A:true;B:false;C:编译错误。 package main import “fmt“ func main() { fmt.Pri
Force buckle 3_ 383. Ransom letter
How diff are the contents of the same configuration item in different environments?
Introducing QA into the software development lifecycle is the best practice that engineers should follow
MYSQL架构——逻辑架构
Practice and principle of PostgreSQL join
Locust性能测试 —— 环境搭建及使用
[Yugong series] go teaching course 003-ide installation and basic use in July 2022
Logo special training camp section III initial creative techniques
Unity-VScode-Emmylua配置报错解决
Short video system source code, click the blank space of the screen, the keyboard does not automatically stow
PMO: compare the sample efficiency of 25 molecular optimization methods
串口数据帧
Detailed explanation of flask context
制作条形码的手机App推荐
LOGO特训营 第五节 字体结构与设计常用技法
Logo special training camp Section V font structure and common design techniques
LOGO特訓營 第一節 鑒別Logo與Logo設計思路
页面关闭前,如何发送一个可靠请求
Domestic database chaos