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 成功

相关推荐
大哥您好6 小时前
QEMU 11.1.2 多架构编译指南(x86_64 / aarch64 / riscv64)
linux·服务器
道满科技7 小时前
Function Calling 参数总出错?只修参数就行
linux·windows·python
Android系统攻城狮7 小时前
Linux Gstreamer深度解析之gst_audio_ring_buffer_prepare_read调用流程与实战(七十四)
linux·运维·服务器·gstreamer音视频·音视频进阶
我科绝伦(Huanhuan Zhou)8 小时前
Linux 通用压力测试脚本合集:磁盘 + 网络
linux·网络·压力测试
狗凯之家源码网10 小时前
纯 PHP+MySQL 应用市场系统源码实测!
开发语言·mysql·php
Soneswy10 小时前
Linux系统篇--重定向与文件操作命令
linux
有毒的教程10 小时前
Linux底层存储路由配
linux·运维·网络
姚远Oracle ACE10 小时前
对比测试了 openGauss、PostgreSQL、Oracle、MySQL 的CPU 指令数
mysql·postgresql·oracle
CJi0NG11 小时前
【自用】MySQL-多表查询
数据库·mysql