当前位置:网站首页>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月测试安装成功
边栏推荐
- Solution to the problem of cross domain inaccessibility of Chrome browser
- Solve the problem that XML, YML and properties file configurations cannot be scanned
- Csdn-nlp: difficulty level classification of blog posts based on skill tree and weak supervised learning (I)
- CSDN question and answer module Title Recommendation task (I) -- Construction of basic framework
- 用于实时端到端文本识别的自适应Bezier曲线网络
- MySQL21-用戶與權限管理
- Adaptive Bezier curve network for real-time end-to-end text recognition
- MySQL18-MySQL8其它新特性
- Technology | diverse substrate formats
- 导入 SQL 时出现 Invalid default value for ‘create_time‘ 报错解决方法
猜你喜欢

Complete web login process through filter

Typescript入门教程(B站黑马程序员)

CSDN question and answer tag skill tree (I) -- Construction of basic framework

Solve the problem of remote connection to MySQL under Linux in Windows

A necessary soft skill for Software Test Engineers: structured thinking

MySQL36-数据库备份与恢复

Case identification based on pytoch pulmonary infection (using RESNET network structure)

CSDN question and answer module Title Recommendation task (I) -- Construction of basic framework

IDEA 导入导出 settings 设置文件

CSDN问答标签技能树(一) —— 基本框架的构建
随机推荐
MySQL18-MySQL8其它新特性
Global and Chinese market of thermal mixers 2022-2028: Research Report on technology, participants, trends, market size and share
[BMZCTF-pwn] 11-pwn111111
MySQL24-索引的数据结构
Const decorated member function problem
[reading notes] rewards efficient and privacy preserving federated deep learning
Introduction tutorial of typescript (dark horse programmer of station B)
Texttext data enhancement method data argument
C language string function summary
Win10: how to modify the priority of dual network cards?
MySQL32-锁
解决扫描不到xml、yml、properties文件配置
Anaconda3 安装cv2
Mysql27 - Optimisation des index et des requêtes
Ueeditor internationalization configuration, supporting Chinese and English switching
[unity] simulate jelly effect (with collision) -- tutorial on using jellysprites plug-in
++Implementation of I and i++
MySQL 29 other database tuning strategies
Water and rain condition monitoring reservoir water and rain condition online monitoring
Mysql30 transaction Basics