MySql8 配置远程连接
安装Mysql后,远程连接报错信息:
FHost ‘192.168.116.1’ is not allowed to connect to this MySQL serverConnection closed by foreign host.
解决办法:
1、创建用户
create user root@"%" IDENTIFIED BY “password”; //代表可以使用root账号从任何机器登陆
2、赋予权限
grant all on . to root@"%";
连接测试:
mysql -h host -u root -p’password’