及上一篇linux安装mysql的说明

mysql8.0安全策略

1
密码规定:数字英文大小写加特殊符号组成(可以不按照规则,详情去百度设置)

2.
mysql数据库用户密码字段不再是password 
而是authentication_string

3
安装后进入 my.cnf文件修改在[mysql]字段后面加入skip-grants-table
重启后进入mysql
执行这条命令:(此处可以不填密码)
update mysql.user set authentication_string='newpassword' where user='root'

4
如果出现没密码正确无法登陆
1.0
因为mysql本身加密方式为plugin: caching_sha2_password
可以在my.cnf文件里面把#authentication_string=mysql_native_password前面的#号去掉再修改密码
2.0可以开启Alter USER 'root'@‘localhost’ IDENTIFIED WITH mysql_native_password  BY '新密码';
来设置密码加方式插件  navicat加密方式为md5;
5退出mysql把文件m.cnf里面的skip-grants-table注释掉,重启,即可用修改后的密码登录

猜你喜欢

转载自www.cnblogs.com/wangbiaohistory/p/10852312.html
今日推荐