欢迎访问 生活随笔!

生活随笔

当前位置: 首页 > 运维知识 > 数据库 >内容正文

数据库

authenticationstring mysql_mysql5.7 的 user表的密码字段从 password 变成了 authentication_string...

发布时间:2025/3/19 数据库 49 豆豆
生活随笔 收集整理的这篇文章主要介绍了 authenticationstring mysql_mysql5.7 的 user表的密码字段从 password 变成了 authentication_string... 小编觉得挺不错的,现在分享给大家,帮大家做个参考.

来源:

http://www.zhimengzhe.com/shujuku/other/267631.html

感觉还是挺坑的 自己没了解清楚 就动手 转帖一下 mark 一下.

1、首先停止正在运行的MySQL进程

Linux下,运行 killall -TERM MySQLd

Windows下,如果写成服务的 可以运行:net stopMySQL,如未加载为服务,可直接在进程管理器中进行关闭。

2、以安全模式启动MySQL

Linux下,运行 /usr/local/mysql/bin/mysqld_safe --skip-grant-tables &

Windows下,在命令行下运行 X:/MySQL/bin/mysqld-nt.exe --skip-grant-tables

3、完成以后就可以不用密码进入MySQL了

Linux下,运行 /usr/local/mysql/bin/mysql -u root -p 进入

Windows下,运行 X:/MySQL/bin/mysql -u root -p 进入

4、更改MySQL数据库密码

>use mysql>update user set authentication_string=password("new_pass") where user="root";>flush privileges;

以上就是mysql 5.7.14+ 版本更改密码, 原来user表的password变成了authentication_string的说明

总结

以上是生活随笔为你收集整理的authenticationstring mysql_mysql5.7 的 user表的密码字段从 password 变成了 authentication_string...的全部内容,希望文章能够帮你解决所遇到的问题。

如果觉得生活随笔网站内容还不错,欢迎将生活随笔推荐给好友。