当前位置:网站首页>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
边栏推荐
- Crawler_crawl wasde monthly supply and demand balance table (example)
- 【HCIE】NO.45 Hub and Spoke配置案例
- prisma使用mongodb副本集群报错引发的一些列问题
- 通关剑指 Offer——剑指 Offer II 008. 和大于等于 target 的最短子数组
- MySQL 5.7 upgrade to 8.0 detailed process
- 转:张五常:比知识更重要的,是思维方式
- 力扣 2127. 参加会议的最多员工数 拓扑剪枝与2360补充
- 物联网通信协议全解析
- go语言中的goroutine(协程)
- Detailed explanation of mysql stored procedure
猜你喜欢

【Gazebo入门教程】第一讲 Gazebo的安装、UI界面、SDF文件介绍

Android studio连接MySQL并完成简单的登录注册功能

数学建模学习笔记:层次分析法(AHP)

CNN 理解神经网络中卷积(大小,通道数,深度)

【HCIE】NO.45 Hub and Spoke配置案例
软件测试分析流程及输出项包括哪些内容?

MySQL String Concatenation - Various String Concatenation Practical Cases

ORA-04044:此处不允许过程、函数、程序包或类型,系统分析与解决

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

【MLT】MLT多媒体框架生产消费架构解析(一)
随机推荐
数学建模学习笔记:层次分析法(AHP)
Android studio连接MySQL并完成简单的登录注册功能
UE4 利用Mixamo自动绑骨并导入虚幻4
11种你需要了解的物联网(IoT)协议
CodeTON Round 2 (Div. 1 + Div. 2, Rated, Prizes!)
【HCIE】NO.30 OSPFv3的基本配置
MobaXsterm如何使用
CAN光端机解决泰和安TX3016C消防主机长距离联网问题 实现CAN与光纤之间的双向数据智能转换
PyQt5_pyqtgraph mouse draws straight lines on line charts
How to quickly delete the compressed package password?
"Digital reconstruction of the system, getting the CEO is the first step"
UE4 创建暂停和结束游戏UI
安全测试常见问题
Mysql return table
Go语言之interface详解
pg数据库报错问题,有懂的吗
[QNX Hypervisor 2.2用户手册]9.17 tolerance
Grid布局介绍
UE4 3DUI显示与交互案例
MySQL 8.0.29 解压版安装教程(亲测有效)