当前位置:网站首页>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月测试安装成功
边栏推荐
- Mysql21 user and permission management
- Software test engineer development planning route
- CSDN question and answer module Title Recommendation task (II) -- effect optimization
- MySQL19-Linux下MySQL的安装与使用
- Solve the problem of remote connection to MySQL under Linux in Windows
- Global and Chinese market of wafer processing robots 2022-2028: Research Report on technology, participants, trends, market size and share
- [programmers' English growth path] English learning serial one (verb general tense)
- MySQL27-索引优化与查询优化
- Technology | diverse substrate formats
- Have you mastered the correct posture of golden three silver four job hopping?
猜你喜欢
API learning of OpenGL (2003) gl_ TEXTURE_ WRAP_ S GL_ TEXTURE_ WRAP_ T
Mysql21 user and permission management
Mysql34 other database logs
高并发系统的限流方案研究,其实限流实现也不复杂
Just remember Balabala
Case identification based on pytoch pulmonary infection (using RESNET network structure)
MySQL36-数据库备份与恢复
CSDN-NLP:基于技能树和弱监督学习的博文难度等级分类 (一)
Moteur de stockage mysql23
ZABBIX introduction and installation
随机推荐
Time complexity (see which sentence is executed the most times)
Mysql32 lock
Mysql24 index data structure
MySQL learning diary (II)
MySQL32-锁
MySQL23-存儲引擎
npm一个错误 npm ERR code ENOENT npm ERR syscall open
[programmers' English growth path] English learning serial one (verb general tense)
Mysql22 logical architecture
MySQL23-存储引擎
第一篇博客
Mysql21 user and permission management
用于实时端到端文本识别的自适应Bezier曲线网络
CSDN question and answer module Title Recommendation task (II) -- effect optimization
Texttext data enhancement method data argument
Solve the problem that XML, YML and properties file configurations cannot be scanned
MySQL 20 MySQL data directory
导入 SQL 时出现 Invalid default value for ‘create_time‘ 报错解决方法
C language string function summary
Kubesphere - deploy the actual combat with the deployment file (3)