当前位置:网站首页>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
边栏推荐
猜你喜欢

新书上市 |《谁在掷骰子?》在“不确定性时代”中确定前行
![[Deep Learning] Target Detection | SSD Principle and Implementation](/img/07/ea4ff3ffbe7e0c11ff7baec0e1818f.jpg)
[Deep Learning] Target Detection | SSD Principle and Implementation

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

The Road to Ad Monetization for Uni-app Mini Program Apps: Rewarded Video Ads

DPW-SDNet: Dual Pixel-Wavelet Domain Deep CNNs for Soft Decoding of JPEG-Compressed Images

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

How strict Typescript strict mode?

Quick Master QML Chapter 6 Animation

你需要知道的ES6—ES13开发技巧

【Network Security Column Directory】--Penguin Column Navigation
随机推荐
拿什么来保护数据安全?基层数据安全体系建设待提升
你需要知道的ES6—ES13开发技巧
解决centos8 MySQL密码问题ERROR 1820 (HY000) You must reset your password using ALTER USER
LeetCode·Daily Question·952. Calculate Maximum Component Size by Common Factor·Union Check
【网络安全专栏目录】--企鹅专栏导航
MySQL 5.7详细下载安装配置教程
JDBC(详解)
cnpm的安装与使用
Enhancing Quality for HEVC Compressed Videos
mysql创建表
大家都在用的plm项目管理软件有哪些
openim支持十万超级大群
史上超强最常用SQL语句大全
Motion Tuned Spatio-temporal Quality Assessmentof Natural Videos
[Deep Learning] Target Detection | SSD Principle and Implementation
mysql去除重复数据
Teach you how to build a permanently running personal server
LeetCode·23.合并K个升序链表·递归·迭代
新书上市 |《谁在掷骰子?》在“不确定性时代”中确定前行
Navicat new database