复制代码
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23#第一步:登录进入数据库 mysql -P 3306 -h 127.0.0.1(你自己的数据库IP地址) -u root -p root # 第二步:切换身份 use mysql # 第三步:查看当前的IP段信息 select user,host from user (此处会罗列user和host信息) # 如果想要所有Ip字段都可以访问数据库,则用下列语句将host = localhost的部分替换成host = % update user set host='%' where host='localhost'; # 第四步,授权给相应的IP grant all privileges on *.* to root@'192.168.1.1' identified by 'password' #第五步,刷新 flush privileges; #执行第三步,查看信息
最后
以上就是机灵红牛最近收集整理的关于Mysql 数据库IP段访问控制的全部内容,更多相关Mysql内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复