当前位置:网站首页>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月测试安装成功
边栏推荐
- Opencv uses freetype to display Chinese
- CSDN问答标签技能树(二) —— 效果优化
- Discriminant model: a discriminant model creation framework log linear model
- Transactions have four characteristics?
- How to change php INI file supports PDO abstraction layer
- Mysql24 index data structure
- Const decorated member function problem
- 【C语言】深度剖析数据存储的底层原理
- Global and Chinese markets for aprotic solvents 2022-2028: Research Report on technology, participants, trends, market size and share
- CSDN question and answer module Title Recommendation task (I) -- Construction of basic framework
猜你喜欢
The underlying logical architecture of MySQL
CSDN Q & a tag skill tree (V) -- cloud native skill tree
Mysql35 master slave replication
MySQL20-MySQL的数据目录
Other new features of mysql18-mysql8
MySQL35-主从复制
MySQL storage engine
windows无法启动MYSQL服务(位于本地计算机)错误1067进程意外终止
基于Pytorch的LSTM实战160万条评论情感分类
CSDN博文摘要(一) —— 一个简单的初版实现
随机推荐
Record the first JDBC
MySQL 20 MySQL data directory
Csdn-nlp: difficulty level classification of blog posts based on skill tree and weak supervised learning (I)
Case identification based on pytoch pulmonary infection (using RESNET network structure)
February 13, 2022-3-middle order traversal of binary tree
Advantages and disadvantages of evaluation methods
MySQL31-MySQL事务日志
Pytoch LSTM implementation process (visual version)
MySQL20-MySQL的数据目录
Complete web login process through filter
Texttext data enhancement method data argument
Introduction tutorial of typescript (dark horse programmer of station B)
Mysql35 master slave replication
用于实时端到端文本识别的自适应Bezier曲线网络
Software test engineer development planning route
基于Pytorch的LSTM实战160万条评论情感分类
In fact, the implementation of current limiting is not complicated
Global and Chinese market of transfer switches 2022-2028: Research Report on technology, participants, trends, market size and share
Win10: how to modify the priority of dual network cards?
npm一个错误 npm ERR code ENOENT npm ERR syscall open