当前位置:网站首页>MySQL 8.0.29 set and modify the default password
MySQL 8.0.29 set and modify the default password
2022-07-30 21:36:00 【front end cry】
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 won't need to enter it to log in.
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 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 Jiaotong University in 2013. I worked in a small company and went to big factories such as Huawei and OPPO. I joined Ali 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
边栏推荐
猜你喜欢

基于ABP实现DDD--仓储实践

Teach you how to build a permanently running personal server

Solve the problem of centos8 MySQL password ERROR 1820 (HY000) You must reset your password using the ALTER USER

【网络安全专栏目录】--企鹅专栏导航

这本记述40年前历史的游戏书,预言的却是当下的事

MySQL 游标

8 ways to get element attributes in JS

cookie和session区别

解决npm warn config global `--global`, `--local` are deprecated. use `--location=global` instead

MySQL Soul 16 Questions, How Many Questions Can You Last?
随机推荐
How do I refresh the company's background management system (Part 1) - performance optimization
Union, the difference between union and structure, the knowledge of enumeration of C language corners
nVisual网络可视化管理平台功能和价值点
牛客网——业务分析-提取值
3 minutes to take you to understand WeChat applet development
It is enough for MySQL to have this article (disgusting typing 37k words, just for Bojun!!!)
go语言慢速入门——流程控制语句
[Limited Time Bonus] 21-Day Learning Challenge - MySQL from entry to mastery
冲刺第六周
Quick Master QML Chapter 6 Animation
解决centos8 MySQL密码问题ERROR 1820 (HY000) You must reset your password using ALTER USER
基于ABP实现DDD--仓储实践
Automatically generate test modules using JUnit4 and JUnitGenerator V2.0 in IDEA
Markdown的使用
Uni-app 小程序 App 的广告变现之路:激励视频广告
JUC原子类详解
The reason for not using bs4 is that the name is too long?Crawl lottery lottery information
MySql 5.7.38下载安装教程 ,并实现在Navicat操作MySql
ClickHouse删除数据之delete问题详解
DPW-SDNet: Dual Pixel-Wavelet Domain Deep CNNs for Soft Decoding of JPEG-Compressed Images