当前位置:网站首页>MySQL 8.0.29 set and modify the default password
MySQL 8.0.29 set and modify the default password
2022-08-02 06:05:00 【m0_66557301】
MySQL 8.0.29 set and modify default password
*Change password:
When logging in, an error was reported because you did not set the initial password of root.
The password is stored in encrypted form in the authentication_string field in the user table in the mysql database.
Reference link:
Do not change the password by
sudo mysql -u root -p
to log in directly.
Modification steps:
Modify mysqld.cnf
sudo vim /etc/mysql/mysql.conf.d/mysqld.cnf
*You can use code without vim.
Add to this fileThe command "skip -grant-tables"
allows you to log in without entering a password.
Restart mysql
service mysql restart// Similarly, there are alsoservice mysql startservice mysql stop
Login to mysql
mysql -u root -p
You will be prompted for a password, but you will be able to log in without entering it.
Modify user table
use mysql ;update user set authentication_string='' where user='root';//Modify the password property to empty.
The plugin field of root is
Remember to flush privileges;
update user set plugin='mysql_native_password' where user='root';
Change it to
p>
ALTER user 'root'@'localhost' IDENTIFIED BY 'whq2242';
quit
- The password can now be changed.
Comment out the one added in mysqld.cnf and restart mysql
You can log in normally.
Let me introduce myself first. The editor graduated from Shanghai Jiaotong University in 2013. I worked in a small company and went to big factories such as Huawei and OPPO. I joined Alibaba in 2018, until now.I know that most junior and intermediate java engineers want to upgrade their skills, they often need to explore their own growth or sign up to study, but for training institutions, the tuition fee is nearly 10,000 yuan, which is really stressful.Self-learning that is not systematic is very inefficient and lengthy, and it is easy to hit the ceiling and the technology stops.Therefore, I collected a "full set of learning materials for java development" for everyone. The original intention is also very simple. I hope to help friends who want to learn by themselves but don't know where to start, and at the same time reduce everyone's burden.Add the business card below to get a full set of learning materials
边栏推荐
- SQL数据表增加列
- YOLOV5学习笔记(四)——项目目录及代码讲解
- 2021年软件测试面试题大全
- MySQL 8.0.28 version installation and configuration method graphic tutorial
- MySQL安装常见报错处理大全
- matlab simulink 飞机飞行状态控制
- CodeTON Round 2 (Div. 1 + Div. 2, Rated, Prizes!) C题
- 地牢大师(DAY 95)
- Does Conway's Law Matter for System Architecture?
- Digicert EV证书签名后出现“证书对于请求用法无效”的解决方案
猜你喜欢
随机推荐
Qt FAQ
选择黑盒测试用例设计方法的综合策略方案总结
pg数据库报错问题,有懂的吗
【QT】Qt Creator生成动态库(DLL)并调用
认识消防报警联网中CAN光纤转换器的光纤接口和配套光纤线缆
Grid布局介绍
MySQL 多表关联一对多查询实现取最新一条数据
go语言中的goroutine(协程)
腾讯注册中心演进及性能优化实践
interrupt()、interrupted()和isInterrupted()你真的懂了吗
[QNX Hypervisor 2.2用户手册]9.20 vdev
MySQL 的 limit 分页查询及性能问题
2022年7月学习计划完成情况
MySQL安装常见报错处理大全
CAN光端机解决泰和安TX3016C消防主机长距离联网问题 实现CAN与光纤之间的双向数据智能转换
ORA-04044:此处不允许过程、函数、程序包或类型,系统分析与解决
MySQL 灵魂 16 问,你能撑到第几问?
在 .NET MAUI 中如何更好地自定义控件
迅为RK3568开发板编译Buildroot-全自动编译
物联网通信协议全解析