当前位置:网站首页>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 -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 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)
PyQt5_pyqtgraph mouse draws straight lines on line charts
MySQL 多表关联一对多查询实现取最新一条数据
MySQL安装教程
通关剑指 Offer——剑指 Offer II 008. 和大于等于 target 的最短子数组
Go语言之interface详解
CAN光端机解决泰和安TX3016C消防主机长距离联网问题 实现CAN与光纤之间的双向数据智能转换
Anatomy of Unreal Playback System (Part 1)
分享|5G+智慧工业园区解决方案(附PDF)
讯飞AIUI智能机器人5-----让器理解你(语音技术综合应用)
随机推荐
UE4 创建开始游戏界面UI
腾讯注册中心演进及性能优化实践
[Digital IC hand-tear code] Verilog fixed priority arbiter | topic | principle | design | simulation
mysql安装教程【安装版】
Live | 7.30 ApacheCon Asia 2022 IOT/IIOT topic, IoTDB PMC Qiao Jialin as the producer
【七夕】是时候展现专属于程序员的“浪漫”了
【HCIE】NO.30 OSPFv3的基本配置
mysql 存储过程详解
MySQL 的 limit 分页查询及性能问题
质数路径(DAY 99)
Matlab学习第二天
MySQL 游标
CodeTON Round 2 (Div. 1 + Div. 2, Rated, Prizes!) C题
翻转(DAY 97)
学内核之五:问题一,关于上下文切换
PDF file conversion format
mysql 8.0.28版本安装配置方法图文教程
棋盘问题(DAY 94)
MP更新操作方式
大屏UI设计-看这一篇就够了