飞天使-mysql8.0远程连接允许
最佳答案 问答题库788位专家为你答疑解惑
mysql -u root -p
查看身份验证类型
mysql> use mysql;
Database changed
mysql> SELECT Host, User, plugin from user;
±----------±-----------------±----------------------+
| Host | User | plugin |
±----------±-----------------±----------------------+
| % | root | caching_sha2_password |
| localhost | mysql.infoschema | caching_sha2_password |
| localhost | mysql.session | caching_sha2_password |
| localhost | mysql.sys | caching_sha2_password |
| localhost | root | caching_sha2_password |
±----------±-----------------±----------------------+
5 rows in set (0.00 sec)
t 用户的验证器插件为 caching_sha2_password
修改身份验证类型(修改密码)
mysql> ALTER USER ‘root’@’%’ IDENTIFIED WITH mysql_native_password BY ‘123456’;
Query OK, 0 rows affected (0.00 sec)
mysql> ALTER USER ‘root’@‘localhost’ IDENTIFIED WITH mysql_native_password BY ‘123456’;
Query OK, 0 rows affected (0.01 sec)
使生效
mysql> FLUSH PRIVILEGES;
1
验证是否生效
mysql> SELECT Host, User, plugin from user;
±----------±-----------------±----------------------+
| Host | User | plugin |
±----------±-----------------±----------------------+
| % | root | mysql_native_password |
| localhost | mysql.infoschema | caching_sha2_password |
| localhost | mysql.session | caching_sha2_password |
| localhost | mysql.sys | caching_sha2_password |
| localhost | root | mysql_native_password |
原文链接:https://blog.csdn.net/wo4641771/article/details/107936838
99%的人还看了
相似问题
猜你感兴趣
版权申明
本文"飞天使-mysql8.0远程连接允许":http://eshow365.cn/6-27812-0.html 内容来自互联网,请自行判断内容的正确性。如有侵权请联系我们,立即删除!
- 上一篇: idea的设置
- 下一篇: cocos creator 资源管理