当前位置:网站首页>Mysql 其他主机无法连接本地数据库
Mysql 其他主机无法连接本地数据库
2022-07-06 09:13:00 【hyh123a】
前言
mysql 无法通过本地 ip,如:本机IP为172.16.16.16
172.16.16.16 连接失败,只能通过127.0.0.1连接。
--- 记录于2021年8月
环境
Ubuntu 20.04
mysql Ver 8.0.26-0ubuntu0.20.04.2 for Linux on x86_64 ((Ubuntu))
其他主机可以Ping通本机
解决
解决这个问题可以尝试以下两点
1、修改用户名 权限
localhost -> % # 这个大多数博客都有提到 不过多说
2、修改 MySQL 配置文件
2.1 查看配置文件所在
cd /etc/mysql
ls
2.2 修改配置文件
sudo nano /etc/mysql/my.cnf # 二选其一 看自己主机上配置文件是哪个
sudo nano /etc/mysql/mysql.conf.d # 二选其一 看自己主机上配置文件是哪个
# 修改 127.0.0.1 => 0.0.0.0
2.3 重启mysql服务
sudo systemctl restart mysql.service
sudo systemctl status mysql.service
# 测试连接成功
其他
如有遗漏欢迎补充
如有问题欢迎留言
如有作用欢迎点赞
2021年8月测试安装成功
边栏推荐
- Mysql28 database design specification
- CSDN问答标签技能树(二) —— 效果优化
- Mysql26 use of performance analysis tools
- Development of C language standard
- How to find the number of daffodils with simple and rough methods in C language
- MySQL21-用户与权限管理
- Mysql23 storage engine
- MySQL22-逻辑架构
- Mysql30 transaction Basics
- 35 is not a stumbling block in the career of programmers
猜你喜欢
Just remember Balabala
Mysql23 storage engine
API learning of OpenGL (2003) gl_ TEXTURE_ WRAP_ S GL_ TEXTURE_ WRAP_ T
数据库中间件_Mycat总结
Navicat 导出表生成PDM文件
MySQL27-索引優化與查詢優化
Pytorch RNN actual combat case_ MNIST handwriting font recognition
MySQL22-逻辑架构
Download and installation of QT Creator
UEditor国际化配置,支持中英文切换
随机推荐
Database middleware_ MYCAT summary
Global and Chinese markets for aprotic solvents 2022-2028: Research Report on technology, participants, trends, market size and share
Win10: how to modify the priority of dual network cards?
Kubesphere - deploy the actual combat with the deployment file (3)
Have you mastered the correct posture of golden three silver four job hopping?
Moteur de stockage mysql23
In fact, the implementation of current limiting is not complicated
[leectode 2022.2.13] maximum number of "balloons"
Pytoch LSTM implementation process (visual version)
pytorch的Dataset的使用
[Li Kou 387] the first unique character in the string
Global and Chinese market of operational amplifier 2022-2028: Research Report on technology, participants, trends, market size and share
Emotional classification of 1.6 million comments on LSTM based on pytoch
CSDN问答标签技能树(五) —— 云原生技能树
Kubernetes - problems and Solutions
What is the difference between TCP and UDP?
The underlying logical architecture of MySQL
[untitled]
[paper reading notes] - cryptographic analysis of short RSA secret exponents
高并发系统的限流方案研究,其实限流实现也不复杂