# 1. 修改mysql配置文件
# linux 配置文件路径 /etc/my.cnf
# [mysqld] 配置项下面增加如下配置
bind-address=0.0.0.0
# 2. 重启服务
systemctl restart mysqld
# 进入mysql终端,执行下面mysql语句进行远程授权,注意替换成自己要设置的密码
# 授权
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'password' WITH GRANT OPTION;
# 刷新权限
flush privileges;
0