设置mysql允许远程访问
设置mysql允许远程访问
1.登陆mysql数据库,修改表。
use mysql;
update user set host=‘%‘ where user=‘root‘;
select host,user from user;
flush privileges;
注意:最后一句很重要,目的是使修改生效,如果没有写,则还是不能进行远程连接。
2.授权用户,允许从任何主机连接到mysql数据库。
grant all privileges on *.* to ‘root‘@‘%‘ identified by ‘pwd‘ with grant option;
flush privileges;
如果只是允许用户从ip为192.168.1.104的主机连接到mysql服务器。
grant all privileges on *.* to ‘root‘@‘%192.168.1.104‘ identified by ‘#‘ with grant option;
flush privileges;
相关推荐
emmm00 2020-11-17
王艺强 2020-11-17
aydh 2020-11-12
世樹 2020-11-11
zry 2020-11-11
URML 2020-11-11
spurity 2020-11-10
yifangs 2020-10-13
Andrea0 2020-09-18
Ida 2020-09-16
ltd00 2020-09-12
tufeiax 2020-09-03
xjd0 2020-09-10
greatboylc 2020-09-10
adsadadaddadasda 2020-09-08
疯狂老司机 2020-09-08
CoderToy 2020-11-16
ribavnu 2020-11-16
bianruifeng 2020-11-16