当前位置:网站首页>MySQL to revise the root password
MySQL to revise the root password
2022-07-31 04:02:00 【Hi teacher, I'm Dabai】
修改root账号密码
示例一:
# IP地址
192.168.70.133
# root 账号密码
Ncayu@bNuPc3
# 更改密码:
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '[email protected]';
# 刷新一下
flush privileges;
# Test whether you can log in normally after changing the account password
mysql -u root -p Ncayu@bNuPc3
示例二:
先修改root账号的“%”权限为“localhost”权限;rootAccounts can only be used locally
修改root账号的密码,Passwords are complex,meet password complexity.
# IP地址 192.168.70.136
shang@Ds9Ed6
mysql> use mysql;
Database changed
mysql> update user set host = "localhost" where user = "root" and host = "%";
Query OK, 1 row affected (0.00 sec)
Rows matched: 1 Changed: 1 Warnings: 0
mysql> select user,host from mysql.user;
更改密码:
mysql> ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '[email protected]';
Query OK, 0 rows affected (0.00 sec)
# Test whether you can log in normally after changing the account password
mysql -u root -p shang@Ds9Ed6
Database account permission recovery
# Database account permission recovery
四、回收权限
删除ncayu这个用户的create权限,该用户将不能创建数据库和表.
revoke all privileges on `webapp`.* from 'ncayu'@'%';
mysql> revoke create on *.* from '[email protected]';
mysql> flush privileges;
3.revoke撤销权限
#revoke跟grant语法差不多,只需要把关键字 “to” 换成 “from” 即可,并且revoke语句中不需要跟密码设置.
注意:revoke可以回收所有权限,也可以回收部分权限.
边栏推荐
- Based on the local, linking the world | Schneider Electric "Industrial SI Alliance" joins hands with partners to go to the future industry
- A brief introduction to the CheckboxListTile component of the basic components of Flutter
- els block to the left to move the conditional judgment
- Redis uses sorted set to cache latest comments
- Redis counts new and retained users
- 安全20220712
- (树) 最近公共祖先(LCA)
- "A daily practice, happy water problem" 1331. Array serial number conversion
- [shell basics] determine whether the directory is empty
- [AUTOSAR-RTE]-5-Explicit (explicit) and Implicit (implicit) Sender-Receiver communication
猜你喜欢

VS QT - ui does not display newly added members (controls) || code is silent

Just debuted "Fight to Fame", safety and comfort are not lost

C语言从入门到如土——数据的存储

How to develop a high-quality test case?

(八)Math 类、Arrays 类、System类、Biglnteger 和 BigDecimal 类、日期类

Why don't you programmers make a living off your own projects?And have to work for someone else?

endian mode

exsl文件预览,word文件预览网页方法

What is a system?

5. How does the SAP ABAP OData service support the $filter operation
随机推荐
volatile内存语义以及实现 -volatile写和读对普通变量的影响
Based on the local, linking the world | Schneider Electric "Industrial SI Alliance" joins hands with partners to go to the future industry
Safety 20220715
Redis counts new and retained users
Learning DAVID Database (1)
端口排查步骤-7680端口分析-Dosvc服务
The els block moves the boundary to the right, and accelerates downward.
三子棋的代码实现
Zotero如何删除自动生成的标签
Summary of Huawei Distributed Storage FusionStorage Knowledge Points [Interview]
【AUTOSAR-RTE】-4-Port and Interface and Data Type
[C language] General method for finding the sum of the greatest common factor and the least common multiple of two integers m and n, the classical solution
Safety 20220722
日志级别 和 打印log注意
Smartcom Programming Level 4 - Magic Academy Lesson 6
beforeDestroy与destroyed的使用
The BP neural network
Safety 20220709
$attrs/$listeners
(六)枚举、注解