如圖所示:mysql
查看 MySQL的配置文件web
[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 截圖同樣就能夠了sql
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