当前位置:网站首页>连接局域网MySql
连接局域网MySql
2022-07-06 09:33:00 【小白说(๑• . •๑)】
连接局域网MySql
今天遇见一个小问题,记录一下。
描述:不同的主机连接局域网内某台主机的MySql数据库。
防火墙设置
因为安全的问题,不能直接关闭防火墙,所以需要设置一下入站规则。
打开:网络和Internet设置->windows防火墙->高级设置。
启用两个规则,属性设置为任意IP地址,局域网内能ping通MySql所在主机IP:
创建一个新的入站规则:可以对任何局域网内任意IP开放一个3306的端口(我使用的mysql服务的端口)。按照顺序操作。
至此,局域网的端口开放就已经完成了。
MySql服务设置
因为MySql默认只支持localhost进行本地访问,本地的IP都不可以访问,所以需要开放一下MySql权限。
- 使用客户端连接到本地MySql服务,打开mysql数据库;(use mysql)
- 查询一下权限对应的IP:SELECT user,host FROM user;
- 找到需要开放权限(用户)的访问IP进行更新(%):update user set host=’%’ where user=‘登录用户root’
- 重启MySql服务或者刷新权限:FLUSH PRIVILEGES
现在就能访问到局域网内的MySql数据库了!
边栏推荐
- Idea resolving jar package conflicts
- Set up the flutter environment pit collection
- Activit fragmented deadly pit
- arithmetic operation
- ByteDance technical Interviewer: what kind of candidate do I want to pick most
- 一个数10年工作经验的微服务架构老师的简历
- Flink源码解读(一):StreamGraph源码解读
- MySQL字符串函数
- ByteDance open source Gan model compression framework, saving up to 97.8% of computing power - iccv 2021
- Control transfer instruction
猜你喜欢
Compile homework after class
算数运算指令
Flink 解析(七):时间窗口
Activit零零碎碎要人命的坑
Fdog series (V): use QT to imitate QQ to realize login interface to main interface, function chapter.
Programmer orientation problem solving methodology
Shell_ 03_ environment variable
Eight part essay that everyone likes
Activiti目录(四)查询代办/已办、审核
程序员定位解决问题方法论
随机推荐
登陆验证koa-passport中间件的简单使用
唯有学C不负众望 TOP4 S1E6:数据类型
Many papers on ByteDance have been selected into CVPR 2021, and the selected dry goods are here
Which is more important for programming, practice or theory [there are some things recently, I don't have time to write an article, so I'll post an article on hydrology, and I'll fill in later]
8086 内存
QT system learning series: 1.2 style sheet sub control lookup
Only learning C can live up to expectations top3 demo exercise
肖申克的救赎有感
README. txt
Flink 解析(五):State与State Backend
Login to verify the simple use of KOA passport Middleware
Activit零零碎碎要人命的坑
Activit fragmented deadly pit
Activiti directory (V) reject, restart and cancel process
JVM运行时数据区之程序计数器
面试集锦库
Shell_ 01_ data processing
Alibaba cloud server builds SVN version Library
Design of DS18B20 digital thermometer system
Alibaba cloud server docker installation mysql5.5