1.mysql的设置
(1)授权
mysql>grant all privileges on *.* to ‘root‘@‘%‘ identified by ‘youpassword‘ with grant option;
mysql>flush privileges;
(2)修改/etc/mysql/my.conf
找到bind-address = 127.0.0.1这一行
改为bind-address = 0.0.0.0即可
重启mysql
2.防火墙开放端口
服务器的防火墙,需要开启3306端口
时间: 2024-10-07 17:26:45