当前位置:网站首页>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
边栏推荐
- Solve the problem of centos8 MySQL password ERROR 1820 (HY000) You must reset your password using the ALTER USER
- MYSQL JDBC图书管理系统
- 【菜鸡含泪总结】如何用pip、anaconda安装库
- cmd(命令行)操作或连接mysql数据库,以及创建数据库与表
- 手把手教你搭建一台永久运行的个人服务器
- openim支持十万超级大群
- mysql创建表
- 新书上市 |《谁在掷骰子?》在“不确定性时代”中确定前行
- (7/29)基础板子最小生成树prim+kruskal
- ClickHouse 创建数据库建表视图字典 SQL
猜你喜欢

cnpm安装步骤

cmd(命令行)操作或连接mysql数据库,以及创建数据库与表

手动从0搭建ABP框架-ABP官方完整解决方案和手动搭建简化解决方案实践

HCIP第十六天

About the data synchronization delay of MySQL master-slave replication

MySQL 游标

Teach you how to build a permanently running personal server

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

QUALITY-GATED CONVOLUTIONAL LSTM FOR ENHANCING COMPRESSED VIDEO

大家都在用的plm项目管理软件有哪些
随机推荐
Automatically generate test modules using JUnit4 and JUnitGenerator V2.0 in IDEA
QUALITY-GATED CONVOLUTIONAL LSTM FOR ENHANCING COMPRESSED VIDEO
DistSQL in-depth analysis: creating a dynamic distributed database
mysql remove duplicate data
MySql创建数据表
A simple rich text editor
【Network Security Column Directory】--Penguin Column Navigation
MySQL60 homework
Markdown的使用
Qt 同时生成动态库和静态库
[Deep Learning] Understanding of Domain Adaptation in Transfer Learning and Introduction of 3 Techniques
史上最全的Redis基础+进阶项目实战总结笔记
NEOVIM下载安装与配置
JDBC (detailed explanation)
Redis数据更新,是先更新数据库还是先更新缓存?
y82.第四章 Prometheus大厂监控体系及实战 -- 监控扩展和prometheus 联邦(十三)
MySQL 用户授权
cnpm的安装与使用
LeetCode·Daily Question·952. Calculate Maximum Component Size by Common Factor·Union Check
系统结构考点之并行主存