vim /etc/mysql/my.cnf
找到
bind-address = 127.0.0.1
改为:
bind-address = 0.0.0.0
#允许任意ip地址访问
也可以指定IP地址。
重启MySQL:
sudo /etc/init.d/mysqld restart
第二步,修改数据库配置:
授权root用户进行远程连接
grant all privileges on *.* to root@"%" identified by "password" with grant option;
flush privileges;
第二行命令使设置生效。
Copyright © 2019- gamedaodao.net 版权所有 湘ICP备2024080961号-6
违法及侵权请联系:TEL:199 18 7713 E-MAIL:2724546146@qq.com
本站由北京市万商天勤律师事务所王兴未律师提供法律服务