mysql 解除数据库访问ip限制

#首先需要关闭防火墙#

systemctl stop firewalld.service            #停止firewall
systemctl disable firewalld.service        #禁止firewall开机启动

— 允许所有远程连接到root权限下的所有数据库

grant all privileges on *.* to root@”%” identified by ‘0’ with grant option;

#  %表示不限制,输入对应的ip地址则解除对应ip地址的访问限制,0表示密码,输入对应的数据访问密码

— 刷新(必要执行的语句)

flush privileges;

创建新用户并给予权限登录数据库

create user ‘gameking’@’%’ identified by ‘root’

grant all on *.* to ‘gameking’@’%’

发表评论

您的电子邮箱地址不会被公开。 必填项已用*标注