mysql安装启动过程中遇到的坑

MySQL8 踩坑

错误:1130 - Host ‘xxxx’ is not allowed to connect to this MySQL server

mysql8以下版本是可以通过

grant all privileges on *.* to [email protected]'host' identified by '密码' with grant option

来授权远程登录的,但是mysql8以后这个不好使了,需要
use mysql;
update user set host = '%' where user = 'root';

允许所有主机远程以root身份登录mysql数据库,想要单台登录的话把%改成单台主机

flush privileges;
然后就好用了
在这里插入图片描述

navicat 连接mysql8.0.21数据库失败

Client does not support authentication protocol requested by server;

在这里插入图片描述

解决方法

alter user ‘root’@’%’ identified with mysql_native_password by ‘123456’;

flush privileges;

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-K8gUAHyj-1596665781683)(C:\Users\staff\AppData\Roaming\Typora\typora-user-images\image-20200806000012936.png)]