Mysql5.7修改root密码教程
作者:炫酷飞扬 时间:2024-01-29 02:20:19
版本更新,原来user里的password字段已经变更为authentication_string
版本更新 缘故,好多网上的教程都不适用了,甚至连官网的文档也不是能够顺利操作的。
如果 MySQL 正在运行,首先杀之:
killall -TERM mysqld。
运行
mysqld_safe --skip-grant-tables &
如果此时不想被远程连接:mysqld_safe –skip-grant-tables –skip-networking &
使用mysql连接server
更改密码:
update mysql.user set authentication_string=password('123qwe') where user='root' and Host = 'localhost';
*特别提醒注意的一点是,新版的mysql数据库下的user表中已经没有Password字段了
而是将加密后的用户密码存储于authentication_string字段
mysql> flush privileges;
mysql> quit;
修改完毕。重启
killall -TERM mysqld。
mysqld_safe &
然后mysql就可以连接了
但是此时操作似乎功能不完全,还要alter user…
alter user 'root'@'localhost' identified by '123';
网文说酱紫也可以:
set password for 'root'@'localhost'=password('123');
cp mysql.server /etc/init.d/mysql
chmod +x /etc/init.d/mysql
chkconfig --add mysql
来源:https://blog.csdn.net/qq_16241043/article/details/53897504
标签:mysql,root密码
![](/images/zang.png)
![](/images/jiucuo.png)
猜你喜欢
python 寻找list中最大元素对应的索引方法
2021-02-16 07:37:52
Python 爬虫之Beautiful Soup模块使用指南
2021-10-16 13:28:03
Python3实现飞机大战游戏
2022-08-25 05:29:03
![](https://img.aspxhome.com/file/2023/6/81826_0s.jpg)
vuex新手进阶篇之actions的使用方法
2024-04-27 16:13:54
![](https://img.aspxhome.com/file/2023/5/132935_0s.jpg)
Symfony核心类概述
2023-11-17 13:59:48
![](https://img.aspxhome.com/file/2023/7/92807_0s.png)
Go 实现 WebSockets和什么是 WebSockets
2024-04-26 17:15:42
![](https://img.aspxhome.com/file/2023/5/134395_0s.png)
javascript实现禁止复制网页内容汇总
2024-04-16 09:31:48
悟道WEB标准:统一思想,遵循标准
2009-10-11 16:38:00
Java获取网络文件并插入数据库的代码
2024-01-23 19:35:10
python爬虫智能翻页批量下载文件的实例详解
2023-06-20 14:17:12
用javascript实现Base64编码
2008-03-04 16:51:00
Python图像处理之几何变换
2021-05-05 12:46:39
![](https://img.aspxhome.com/file/2023/0/131560_0s.png)
Mysql数据库性能优化三(分表、增量备份、还原)
2024-01-21 00:38:54
![](https://img.aspxhome.com/file/2023/9/92769_0s.png)
快速掌握JavaScript正则表达式
2010-01-23 11:39:00
SQL SERVER性能优化综述(很好的总结,不要错过哦)第1/3页
2024-01-14 13:43:58
PHP微信开发之查询微信精选文章
2023-11-14 12:45:54
Python Pandas 修改表格数据类型 DataFrame 列的顺序案例
2023-02-27 17:47:37
10个Python面试常问的问题(小结)
2023-04-11 19:36:15
将字典转换为DataFrame并进行频次统计的方法
2023-11-21 05:37:30
![](https://img.aspxhome.com/file/2023/2/81712_0s.jpg)
Django+Celery实现动态配置定时任务的方法示例
2021-06-11 13:56:19
![](https://img.aspxhome.com/file/2023/4/87704_0s.png)