DataGrip 连接 Centos MySql失败

  1. 首先检查Mysql是否运行:
    systemctl status mysqld , 如果显示没有启动则需要启动mysql

  2. 检查防火墙是否打开,是否打开3306的端口
    sudo firewall-cmd --list-all

    如果下面3306没有打开则打开3306端口

    public
    target: default
    icmp-block-inversion: no
    interfaces:
    sources:
    services: dhcpv6-client ssh
    ports: 3306/tcp
    protocols:
    masquerade: no
    forward-ports:
    source-ports:
    icmp-blocks:
    rich rules:

sudo firewall-cmd --zone=public --add-port=3306/tcp --permanent 如果添加成功则显示success

  1. 本地测试是否能够连接成功 telnet ip 3306 显示连接实现但是ping ip可以成功

  2. 后来想到这事一个云服务器,可能和网页设置的入站规则有关系

  3. 打开腾讯云的出入站规则设置发现没有打开3306端口,打开端口

  4. 重新使用telnet连接成功。

  5. 使用datagrip登录,test connection 成功

相关推荐
默|笙5 小时前
【Linux网络】网络层协议 IP(1)理解报头、网段划分
linux·网络·tcp/ip
修己xj8 小时前
nslookup 使用指南:两种模式与常用查询技巧
linux
唠玖馆10 小时前
文件系统详解
linux·文件系统·ext2
GeW10 小时前
当Linux内核开始“确定性”,制造高端化才有了底层语法
linux
这个DBA有点耶12 小时前
函数索引的“完全一致”有多苛刻:写法、字符集、类型,差一处就失效
数据库·mysql·代码规范
星恒随风12 小时前
MySQL 从零入门(三):表的约束详解
linux·服务器·数据库·笔记·mysql
StarsGreen14 小时前
libva在intel平台上的前端流程简介
linux
坤坤子吖16 小时前
Linux网络编程:自定义应用层协议与 JSON 序列化
linux·服务器·网络·c++·笔记·json
Felven18 小时前
华为鲲鹏920s芯片serdestool工具使用说明
linux·运维·服务器·华为·鲲鹏920·serdestool
莫晓燚18 小时前
mall 电商项目完整部署---实战
linux·运维·docker·容器