当前位置:网站首页>Mysql8.0 forgot the root password
Mysql8.0 forgot the root password
2022-06-28 08:33:00 【Fire founder】
1、 edit mysql The configuration file :vim /etc/my.cnf, add to skip-grant-table( Skip table permission verification )
After the modification esc :wq! Save and exit .
2、 restart mysql service
systemctl restart mysqld
3、 Refresh permission table :flush privileges;
flush privileges;
4、mysql Sign in :mysql -uroot -p( No password required )
5、 Password reset
## The first root Your old password becomes empty
use mysql;
update user set authentication_string='' where user='root';
## Then reset the new password
ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY '@Zcw140619';
flush privileges; ## Refresh the permissions again
6、 Edit again mysql The configuration file vim /etc/my.cnf, Delete or comment skip-grant-table
7、 Restart again mysql service
systemctl restart mysqld
8、 Using the new root Whether the password login verification is modified successfully
mysql -uroot -p New password
9、 Successfully logged in

边栏推荐
猜你喜欢

In flood fighting and disaster relief, the city donated 100000 yuan of love materials to help Yingde

Set the encoding of CMD to UTF-8

The 6th smart home Asia 2022 will be held in Shanghai in October

AWS builds a virtual infrastructure including servers and networks (2)

MySQL8.0 忘记 root 密码
![DELL R730服务器开机报错:[XXX] usb 1-1-port4: disabled by hub (EMI?), re-enabling...](/img/90/425965ca4b3df3656ce2a5f4230c4b.jpg)
DELL R730服务器开机报错:[XXX] usb 1-1-port4: disabled by hub (EMI?), re-enabling...

Kubernetes notes and the latest k3s installation introduction

JS rounding tips

利尔达低代码数据大屏,铲平数据应用开发门槛

Reverse mapping of anonymous pages
随机推荐
A - 深海探险
开户券商怎么选择?网上开户是否安全么?
About RAC modifying scan IP
B_QuRT_User_Guide(27)
duilib 入门基础十二 样式类
[learning notes] matroid
B_ QuRT_ User_ Guide(29)
为什么函数模板没有偏特化?
Anniversary party
WasmEdge 0.10.0 发布!全新的插件扩展机制、Socket API 增强、LLVM 14 支持
【Go ~ 0到1 】 第二天 6月25 Switch语句,数组的声明与遍历
【力扣10天SQL入门】Day5+6 合并表
新唐NUC980使用记录:自制开发板(基于NUC980DK61YC)
MySQL8.0 忘记 root 密码
App automated testing appium Tutorial Part 1 - advanced supplementary content
The maximum number of Rac open file descriptors, and the processing of hard check failure
A - deep sea exploration
[introduction to SQL for 10 days] day4 Combined Query & specified selection
Login common test case
AWS builds a virtual infrastructure including servers and networks (2)