当前位置:网站首页>【踩坑系列】mysql 修改root密码失败
【踩坑系列】mysql 修改root密码失败
2022-07-03 07:36:00 【涛涛之海】
【踩坑系列】 mysql 修改root密码失败
问题原因
mysql 修改root密码失败 ,主要是因为root的host不是localhost,是%的问题。
修改密码的步骤
-- 切换到 mysql bin 路径
--先登录mysql
mysql -u root -p
--输入密码
-- 切换到mysql数据
use mysql;
-- 查询用户信息
select user,host from user;
+------------------+-----------+
| user | host |
+------------------+-----------+
| root | % |
| admin | localhost |
| mysql.infoschema | localhost |
| mysql.session | localhost |
| mysql.sys | localhost |
| zhangj | localhost |
+------------------+-----------+
注意我的root,host是’%’
ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY '123';
边栏推荐
- What did the DFS phase do
- Go language foundation ----- 18 ----- collaboration security, mutex lock, read-write lock, anonymous lock, sync Once
- Understanding of class
- Common architectures of IO streams
- Chapter VI - Containers
- Partage de l'expérience du projet: mise en œuvre d'un pass optimisé pour la fusion IR de la couche mindstore
- 技术干货|昇思MindSpore NLP模型迁移之LUKE模型——阅读理解任务
- Go language foundation ------ 12 ------ JSON
- Implementation of breadth first in aggregation in ES
- VMware network mode - bridge, host only, NAT network
猜你喜欢
Go language foundation ------ 14 ------ gotest
HarmonyOS第三次培训笔记
技术干货|百行代码写BERT,昇思MindSpore能力大赏
PAT甲级 1027 Colors in Mars
技术干货|AI框架动静态图统一的思考
Why is data service the direction of the next generation data center?
Epoll related references
Hnsw introduction and some reference articles in lucene9
PAT甲级 1032 Sharing
专题 | 同步 异步
随机推荐
输入三次猜一个数字
PAT甲级 1028 List Sorting
Reconnaissance et détection d'images - Notes
技术干货|利用昇思MindSpore复现ICCV2021 Best Paper Swin Transformer
What did the DFS phase do
Vertx metric Prometheus monitoring indicators
技术干货 | AlphaFold/ RoseTTAFold开源复现(2)—AlphaFold流程分析和训练构建
Use of file class
lucene scorer
PAT甲级 1027 Colors in Mars
Technology dry goods | luxe model for the migration of mindspore NLP model -- reading comprehension task
GoLang之结构体
【LeetCode】4. Best Time to Buy and Sell Stock·股票买卖最佳时机
Introduction of buffer flow
[coppeliasim4.3] C calls UR5 in the remoteapi control scenario
密西根大学张阳教授受聘中国上海交通大学客座教授(图)
【MySQL 12】MySQL 8.0.18 重新初始化
项目经验分享:基于昇思MindSpore,使用DFCNN和CTC损失函数的声学模型实现
Go language foundation ----- 06 ----- anonymous fields, fields with the same name
IndexSort