当前位置:网站首页>连接局域网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断点调试技巧,多张动图包教包会。
- The QT program compiled on CentOS lacks a MySQL driven solution
- Yum install XXX reports an error
- Von Neumann architecture
- Many papers on ByteDance have been selected into CVPR 2021, and the selected dry goods are here
- Only learning C can live up to expectations TOP4 S1E6: data type
- 姚班智班齐上阵,竞赛高手聚一堂,这是什么神仙编程大赛?
- Activiti directory (III) deployment process and initiation process
- Logical operation instruction
- was unable to send heartbeat
猜你喜欢
Logical operation instruction
学习投资大师的智慧
MySQL string function
Idea breakpoint debugging skills, multiple dynamic diagram package teaching package meeting.
Some feelings of brushing leetcode 300+ questions
Prototype chain inheritance
汇编语言寻址方式
Yao BanZhi and his team came together, and the competition experts gathered together. What fairy programming competition is this?
Activiti目录(五)驳回、重新发起、取消流程
JVM类加载子系统
随机推荐
Typescript basic operations
Data transfer instruction
The "advertising maniacs" in this group of programmers turned Tiktok advertisements into ar games
Conception du système de thermomètre numérique DS18B20
MySQL optimization notes
Introduction to spring trick of ByteDance: senior students, senior students, senior students, and the author "brocade bag"
mysql的列的数据类型详解
When it comes to Google i/o, this is how ByteDance is applied to flutter
Activiti目录(五)驳回、重新发起、取消流程
汇编语言寻址方式
JVM类加载子系统
Interpretation of Flink source code (III): Interpretation of executiongraph source code
服务器端渲染(SSR)和客户端渲染(CSR)的区别
JVM之垃圾回收器上篇
Only learning C can live up to expectations top3 demo exercise
冯诺依曼体系结构
In the command mode in the VI editor, delete the character usage at the current cursor__ Command.
Flink 解析(二):反压机制解析
@RestController、@Controller
Control transfer instruction