zoukankan      html  css  js  c++  java
  • zabbix 搭建 mysql 连接报错

    如图所示:

    查看 MySQL的配置文件

    [root@zbxtest ~]# cat /etc/my.cnf
    [mysqld]
    datadir=/data/mysql
    socket=/data/mysql/mysql.sock
    # Disabling symbolic-links is recommended to prevent assorted security risks
    symbolic-links=0
    # Settings user and group are ignored when systemd is used.
    # If you need to run mysqld under a different user or group,
    # customize your systemd unit file for mariadb according to the
    # instructions in http://fedoraproject.org/wiki/Systemd
    
    [mysqld_safe]
    log-error=/var/log/mariadb/mariadb.log
    pid-file=/var/run/mariadb/mariadb.pid
    
    #
    # include all files from the config directory
    #
    !includedir /etc/my.cnf.d
    [client]
    socket=/data/mysql/mysql.sock
    [root@zbxtest ~]# ps -ef |grep mysql 
    mysql     10339      1  0 13:27 ?        00:00:00 /bin/sh /usr/bin/mysqld_safe --basedir=/usr
    mysql     10500  10339  0 13:27 ?        00:00:01 /usr/libexec/mysqld --basedir=/usr --datadir=/data/mysq --plugin-dir=/usr/lib64/mysql/plugin --log-error=/var/log/mariadb/mariadb.log --pid-file=/var/run/mariadb/mariadb.pid --socket=/data/mysql/mysql.sock
    root      11548  10030  0 13:37 pts/0    00:00:00 grep --color=auto mysql

    socket 配置 与 zabbix web 不相符 ,需要修改 my.cnf 文件内容,把socket修改成与那个zabbix web 截图一样就可以了

    1 [root@zbxtest my.cnf.d]# egrep -v "^#|^$" /etc/my.cnf
    2 [mysqld]
    3 datadir=/data/mysql
    4 socket=/var/lib/mysql/mysql.sock
    5 symbolic-links=0
    6 [mysqld_safe]
    7 log-error=/var/log/mariadb/mariadb.log
    8 pid-file=/var/run/mariadb/mariadb.pid
    9 !includedir /etc/my.cnf.d
  • 相关阅读:
    在画图时添加中文
    legend图例
    数组的拼接
    将多维数组改为一维数组
    ChinaCock扫描控件介绍-使用TCCBarcodeScanner引起app闪退
    ChinaCock打印控件介绍-TCCFujitsuPrinter实现蓝牙针式打印
    用NetHttpClient执行Post操作遇到的问题
    【转】FireMonkey ListView 自动计算行高
    基于MQTT的串口数据转发器
    kbmMW均衡负载与容灾(1)
  • 原文地址:https://www.cnblogs.com/shuitian-ys/p/11363455.html
Copyright © 2011-2022 走看看