当前位置:网站首页>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可以回收所有权限,也可以回收部分权限.
边栏推荐
- Why don't you programmers make a living off your own projects?And have to work for someone else?
- Unity2D 自定义Scriptable Tiles的理解与使用(四)——开始着手构建一个基于Tile类的自定义tile(下)
- 安全20220718
- $attrs/$listeners
- Summary of Huawei Distributed Storage FusionStorage Knowledge Points [Interview]
- Can‘t load /home/Iot/.rnd into RNG
- Redis 使用 sorted set 做最新评论缓存
- Redis uses sorted set to cache latest comments
- Safety 20220722
- With 7 years of experience, how can functional test engineers improve their abilities step by step?
猜你喜欢

Port inspection steps - 7680 port analysis - Dosvc service

端口排查步骤-7680端口分析-Dosvc服务

Key Technologies of Interface Testing

组件传值 provide/inject

Unity2D 自定义Scriptable Tiles的理解与使用(四)——开始着手构建一个基于Tile类的自定义tile(下)

BP神经网络

(四)递归、可变参数、访问修饰符、理解 main 方法、代码块

安全20220712

(4) Recursion, variable parameters, access modifiers, understanding main method, code block

SIP Protocol Standard and Implementation Mechanism
随机推荐
Safety 20220722
With 7 years of experience, how can functional test engineers improve their abilities step by step?
【AUTOSAR-RTE】-4-Port and Interface and Data Type
beforeDestroy与destroyed的使用
5. How does the SAP ABAP OData service support the $filter operation
The BP neural network
MySQL 8.0.30 GA
Regarding the primary key id in the mysql8.0 database, when the id is inserted using replace to be 0, the actual id is automatically incremented after insertion, resulting in the solution to the repea
进程间通信
Web container and IIS --- Middleware penetration method 1
Safety 20220709
errno error code and meaning (Chinese)
Select the smoke test case, and make the first pass for the product package entering QA
type_traits元编程库学习
binom二项分布,
qlib自动化quant
VS QT - ui does not display newly added members (controls) || code is silent
Detailed explanation of TCP (2)
idea工程明明有依赖但是文件就是显示没有,Cannot resolve symbol ‘XXX‘
(5) final, abstract class, interface, inner class