zabbix连接mysql,zabbix 搭建 mysql 连接报错

如图所示:

1cf106557207d3d51ae69504c32e36ec.png

查看 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

标签:00,log,zabbix,报错,mysql,var,mysqld,mariadb

来源: https://www.cnblogs.com/shuitian-ys/p/11363455.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值