今天第一次使用mysql8.0版本,使用之前在mysql5.7版本修改密码命令报错
update user set authentication_string = password("root") where user = "root";
然后经过翻阅资料发现mysql 5.7.9以后废弃了password字段和password()函数;authentication_string:字段表示用户密码,而authentication_string字段下只能是mysql加密后的41位字符串密码
所以有了新的修改密码的方式,用以下命令
alter user "root"@"localhost" identified by "admin";
最后别忘记刷新权限
flush privileges;
这样就修改好了
- 标签
- mysql
内容版权声明:除非注明,否则皆为本站原创文章。
转载注明出处:https://sulao.cn/post/774
相关推荐
- ubuntu在线安装mysql8无法使用账户密码登陆的问题
- ubuntu22.04编译安装mysql8
- flask使用celery异步定时任务备份mysql数据库
- mysql8登录报错Host '127.0.0.1' is not allowed to connect...
- python使用peewee(ORM)操作mysql数据库
- MySQL CPU占用过高的排查方法
- docker-compose编排lnmp(nginx+php+mysql)环境
- docker和docker-compose分别部署mysql5.7
- centos7编译安装mysql8
- windows系统上mysql8免装版安装教程
评论列表