MySQL 配置外网访问。
测试环境
#
#
Ubuntu 18.04
MySQL 5.7.22
配置过程
编辑 /etc/mysql/my.cnf
,添加如下配置。
#
#
[mysqld]
bind-address = 0.0.0.0
配置用户 (不建议配置 root 远程登陆)
#
#
GRANT ALL PRIVILEDGES ON *.* TO 'root'@'%' identified By 'password';
grant all on vuldb.* to vuluser@'%' identified by 'vulpassword';
然后重启
#
#
service mysql restart
再次检查权限情况
#
#
select user, host from mysql.user;
参考资料
http://www.cnblogs.com/tovep/archive/2012/10/09/2716672.html
Leave a Reply