mac下重置mysl8.0.11密码
mac下重置mysl8.0.11密码
mac下安装mysql8.0.11时 要求输入密码 之后想修改密码
- 注意 此方法适用于mac下的mysql8.0.11 其他版本不一定相同
1.启动mysql后正常登陆
2.查看sql中的root用户
select host, user, authentication_string, plugin from mysql.user; +-----------+------------------+-------------------------------------------+-----------------------+ | host | user | authentication_string | plugin | +-----------+------------------+-------------------------------------------+-----------------------+ | localhost | mysql.infoschema | *THISISNOTAVALIDPASSWORDTHATCANBEUSEDHERE | mysql_native_password | | localhost | mysql.session | *THISISNOTAVALIDPASSWORDTHATCANBEUSEDHERE | mysql_native_password | | localhost | mysql.sys | *THISISNOTAVALIDPASSWORDTHATCANBEUSEDHERE | mysql_native_password | | localhost | root | *23AE809DDACAF96AF0FD78ED04B6A265E05AA257 | mysql_native_password | +-----------+------------------+-------------------------------------------+-----------------------+ 4 rows in set (0.00 sec)
3.重置密码
语法格式
select host, user, authentication_string, plugin from user;
- plugin 密码加密方式
- authentication_string 加密后的密码
- 注意 mysql8.0以后废弃了PASSWORD函数 添加密码的时候不需要使用函数
清空root密码
update user set authentication_string='你的密码' where mysql.user='root';
4.测试
mysql -uroot -p你的密码
相关推荐
chensen 2020-11-14
lwnylslwnyls 2020-11-06
ATenhong 2020-10-15
yanzhelee 2020-10-13
佛系程序员J 2020-10-10
guojin0 2020-10-08
佛系程序员J 2020-10-08
bluewelkin 2020-09-16
wwzaqw 2020-09-04
zhongdaowendao 2020-09-02
favouriter 2020-08-18
奎因amp华洛 2020-08-15
一青年 2020-08-13
千锋 2020-08-10
nangongyanya 2020-08-09
dongxurr 2020-08-08
明天你好 2020-08-03
kyelu 2020-08-03
Ashes 2020-08-03