Ad Widget

Collapse

ERROR 2002 (HY000): Can not connect to local MySQL server through another socket

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • gaguilerag
    Junior Member
    • May 2019
    • 1

    #1

    ERROR 2002 (HY000): Can not connect to local MySQL server through another socket

    Hi all

    I have installed a Zabbix 4.2 server on CentOS 7 and I try to monitor mariadb on another server.

    "Mariadb Server Version: '10 .1.40-MariaDB 'socket:' /mariadb/mysql/mysql.sock 'port: 3306."

    I configure /var/liz/zabbix/.my.cnf with a username and password of user enabled according to the route specified in /etc/zabbix/zabbix_agentd.d/userparameter_mysql.conf.

    Locally, I connect with the user and the password set in /var/liz/zabbix/.my.cnf; and it works correctly, but when I try to configure the zabbix template monitor I choose the following error:

    10237: 20190531: 200141.248 EXECUTE_STR () command: 'echo "show global status where Variable_name =' ';" | HOME = / var / lib / zabbix mysql -N | awk '{print $ 2}' 'len: 123 cmd_result:' ERROR 2002 (HY000): '
    10237: 20190531: 200141.248 Sending back [ERROR 2002 (HY000): Can not connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (13 "Permission denied")]

    How can I change the path of the mysql.sock of the monitor so that it is the same as the one that is running the MariaDB service?
Working...