故障描述:如图所示,默认zabbinx是去/var/lib/mysql/mysql.sock目录下寻找sock的,但是大都童鞋都是把sock放到/tmp目录下在安装过程中会在 /etc/zabbix/zabbix_server.conf 设置DBSocket=/tmp/mysql.soc 所以跟上述的/var/lib/mysql/mysql.sock有冲突
报错:mysql_connect(): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) [include/db.inc.php:77]
Error connecting to database [Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)]
解决方法:给/tmp/mysql.sock设置个软连接,ln -s /tmp/mysql.sock /var/lib/mysql/mysql.sock 这样zabbix就可以找到mysql的sock了
报错:mysql_connect(): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) [include/db.inc.php:77]
Error connecting to database [Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)]
解决方法:给/tmp/mysql.sock设置个软连接,ln -s /tmp/mysql.sock /var/lib/mysql/mysql.sock 这样zabbix就可以找到mysql的sock了
0
为啥我的不行,学长,我也是按照您的步骤改的:
1.创建软连接 ln -s /tmp/mysql.sock /var/lib/mysql/mysql.sock
2.修改/etc/zabbix/zabbix_server.conf,中的DBSocket=/var/lib/mysql/mysql.sock
还有哪里我没有修改的吗?
1.创建软连接 ln -s /tmp/mysql.sock /var/lib/mysql/mysql.sock
2.修改/etc/zabbix/zabbix_server.conf,中的DBSocket=/var/lib/mysql/mysql.sock
还有哪里我没有修改的吗?
编辑回复