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
  • 相关阅读:
    ul做导航栏
    论布局,bfc,margin塌陷和合并,经典bug
    mon-hom
    新浪下拉菜单模仿
    JQ筛选方法,筛选父子元素
    JQuery筛选选择器
    JQuery隐式迭代
    python 和 C# DES加密
    交互设计[1]--设计心理学
    javascript学习(9)——[设计模式]单例
  • 原文地址:https://www.cnblogs.com/shuitian-ys/p/11363455.html
Copyright © 2011-2022 走看看