当前位置:网站首页>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 -p
to 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 stop
Login to mysql
mysql -u root -p
You 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
边栏推荐
- GPGGA NTRIP RTCM Notes
- JUC原子类详解
- Google Earth Engine ——ee.List.sequence函数的使用
- 不用bs4的原因居然是名字太长?爬取彩票开奖信息
- Automatically generate test modules using JUnit4 and JUnitGenerator V2.0 in IDEA
- Outsourcing worked for three years, it was abolished...
- 【信息安全技术】RSA算法的研究及不同优化策略的比较
- The structure of knowledge in the corners of the C language
- LeetCode · 23. Merge K ascending linked lists · recursion · iteration
- 这本记述40年前历史的游戏书,预言的却是当下的事
猜你喜欢
随机推荐
导航栏----个人中心 Dropdown
kubernetes
nVisual网络可视化管理平台功能和价值点
Typescript 严格模式有多严格?
LeetCode·每日一题·952.按公因数计算最大组件大小·并查集
Outsourcing worked for three years, it was abolished...
基于ABP实现DDD--仓储实践
JUC原子类详解
DPW-SDNet: Dual Pixel-Wavelet Domain Deep CNNsfor Soft Decoding of JPEG-Compressed Images
How do I refresh the company's background management system (Part 1) - performance optimization
Teach you how to build a permanently running personal server
Uni-app 小程序 App 的广告变现之路:激励视频广告
DistSQL in-depth analysis: creating a dynamic distributed database
解决npm warn config global `--global`, `--local` are deprecated. use `--location=global` instead
用于视频压缩伪影消除的深度卡尔曼滤波网络
MySQL 有这一篇就够(呕心狂敲37k字,只为博君一点赞!!!)
About the error of SFML Rect.inl file
DPW-SDNet: Dual Pixel-Wavelet Domain Deep CNNs for Soft Decoding of JPEG-Compressed Images
Navigation Bar----Personal Center Dropdown
Qt 同时生成动态库和静态库