当前位置:网站首页>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 -pto 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 stopLogin to mysql
mysql -u root -pYou 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
边栏推荐
猜你喜欢

matlab simulink 模糊pid结合smith控制温度

Android Studio 实现登录注册-源代码 (连接MySql数据库)

来自雪域高原的馈赠——大凉山高原生态糖心苹果

数据湖:流计算处理框架Flink概述

如何运用3DGIS技术整合智慧社区综合管理解决方案

2021年软件测试面试题大全

matlab simulink 飞机飞行状态控制

Live | 7.30 ApacheCon Asia 2022 IOT/IIOT topic, IoTDB PMC Qiao Jialin as the producer

CAN光端机解决泰和安TX3016C消防主机长距离联网问题 实现CAN与光纤之间的双向数据智能转换

Mycat2.0搭建教程
随机推荐
MP更新操作方式
使用pycharm debug 深度学习代码
go语言中的goroutine(协程)
[网鼎杯 2020 青龙组]singal
单调队列模板 滑动窗口
找倍数(DAY 98)
力扣练习——41 对称二叉树
MySQL 的 limit 分页查询及性能问题
pg数据库报错问题,有懂的吗
[QNX Hypervisor 2.2用户手册]9.18 unsupported
MySQL 5.7 upgrade to 8.0 detailed process
canvas 像素操作(图片像素操作)
Crawler_crawl wasde monthly supply and demand balance table (example)
牛客-TOP101-BM41
【疑问】最终推荐的loose pattern 如果依赖module 没有加载完毕,行为如何,是否报错
CubeSat Light-1
MySQL String Concatenation - Various String Concatenation Practical Cases
力扣练习——48 找到小镇的法官
MySql字符串拆分实现split功能(字段分割转列、转行)
MySQL multi-table association one-to-many query to get the latest data