2002 - Can‘t connect to server on ‘192.168.1.XX‘ (36)

参考:2002 - Can't connect to server on '192.168.1.XX' (36)

ubantu20.04,mysql5.7.13

navicat 远程连接数据库报错 2002 - Can't connect to server on '192.168.1.61' (36)

一、查看数据库服务是否有启动,发现有启动

systemctl status mysql

二、查看数据库端口是否是3306,结果是3306

show global variables like 'port';

三、查看root用户权限,是否有开放远程连接,看了是有开放,%代表允许远程

select user,host from mysql.user;

四、 最后排查到mysql 的配置文件

路径/etc/mysql/mysql.conf.d

cd到该路径,然后 命令行运行 vi mysqld.conf 进行编辑

127.0.0.1是本地的意思,bind绑定了本地地址,只能本地访问

把bind地址改成0.0.0.0就可以了

连接成功

之后重启mysql即可

sudo service mysql restart

相关推荐
handler012 小时前
【MySQL】常用命令总结(库与表增删查改)
运维·数据库·mysql·命令·总结
week@eight2 小时前
Linux - Doris
linux·运维·数据库·mysql
苏渡苇4 小时前
Spring Cloud Alibaba:将 Sentinel 熔断限流规则持久化到 Nacos 配置中心
数据库·spring boot·mysql·spring cloud·nacos·sentinel·持久化
杨云龙UP5 小时前
Oracle Recycle Bin 回收站详解:DROP TABLE 后还能找回吗?
linux·运维·数据库·sql·mysql·oracle
Fanta丶6 小时前
7.MySql函数使用 字符串、数值、日期、流程函数
mysql
Navicat中国7 小时前
如何专业化地导出数据
数据库·导出数据·navicat·数据
代码中介商8 小时前
MySQL 存储过程与触发器完全指南
数据库·mysql
Yupureki8 小时前
《MySQL数据库基础》9.索引原理
linux·运维·服务器·网络·数据库·mysql
李少兄8 小时前
MySQL分页重复问题深度剖析
android·数据库·mysql
Yupureki9 小时前
《MySQL数据库基础》8.复合查询
linux·运维·服务器·网络·数据库·mysql