New installation of Zabbix on an Azure VM
Upon loading http://**.**.*.**/zabbix/setup.php
I'm getting an error "Cannot connect to the database. No such file or directory" - on the Configure DB page.
I'm certain this is probably a sock file issue, but I've set everything up correctly, lengthy details as follows:
System details:
O/S Red Hat Enterprise Linux release 8.4 (Ootpa)
Zabbix 6.0 LTS
MySQL: 8.0.29
Installation instructions have been exactly followed as on Download and install Zabbix 6.0 LTS for Red Hat Enterprise Linux 8, MySQL
Apart from, following the error and extensive research, I've recreated the mysql zabbix user using Native password, as I read on another post this may fix the issue. It hasn't.
create user 'zabbix'@'localhost' identified with mysql_native_password by '*******'; # (21 char in length including upper/lower case, numbers and special chars (specifically £))
grant all privileges on zabbix.* to 'zabbix'@'localhost';
MySQL sock file has been moved to a separate disk that will hold the database files.
[root@????]# cd /data/mysql
[root@????]# ls -al mysql.sock srwxrwxrwx. 1 mysql mysql 0 Jun 23 13:15 mysql.sock
MySQL config details:
/etc/my.cnf details:
[client]
socket=/data/mysql/mysql.sock
[mysqld]
datadir=/data/mysql
#socket=/var/lib/mysql/mysql.sock
socket=/data/mysql/mysql.sock
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
default-authentication-plugin=mysql_native_password
Zabbix config:
/etc/zabbix/zabbix_server.conf:
DBHost=localhost
DBName=zabbix
DBUser=zabbix
DBPassword=**********
DBSocket=/data/mysql/mysql.sock
The local zabbix linux user can connect fine to mysql
[root@????]# su - zabbix
[zabbix@????]$ mysql -u zabbix -p zabbix
Enter password:
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 193
Server version: 8.0.29 MySQL Community Server - GPL
Copyright (c) 2000, 2022, Oracle and/or its affiliates.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> show tables;
+----------------------------+
| Tables_in_zabbix |
+----------------------------+
| acknowledges |
| actions |
I've looked in the following logs and can't find any errors.
/var/log/zabbix/zabbix_server.log
/var/log/mysqld.log
/var/log/messages
Please help me!
Upon loading http://**.**.*.**/zabbix/setup.php
I'm getting an error "Cannot connect to the database. No such file or directory" - on the Configure DB page.
I'm certain this is probably a sock file issue, but I've set everything up correctly, lengthy details as follows:
System details:
O/S Red Hat Enterprise Linux release 8.4 (Ootpa)
Zabbix 6.0 LTS
MySQL: 8.0.29
Installation instructions have been exactly followed as on Download and install Zabbix 6.0 LTS for Red Hat Enterprise Linux 8, MySQL
Apart from, following the error and extensive research, I've recreated the mysql zabbix user using Native password, as I read on another post this may fix the issue. It hasn't.
create user 'zabbix'@'localhost' identified with mysql_native_password by '*******'; # (21 char in length including upper/lower case, numbers and special chars (specifically £))
grant all privileges on zabbix.* to 'zabbix'@'localhost';
MySQL sock file has been moved to a separate disk that will hold the database files.
[root@????]# cd /data/mysql
[root@????]# ls -al mysql.sock srwxrwxrwx. 1 mysql mysql 0 Jun 23 13:15 mysql.sock
MySQL config details:
/etc/my.cnf details:
[client]
socket=/data/mysql/mysql.sock
[mysqld]
datadir=/data/mysql
#socket=/var/lib/mysql/mysql.sock
socket=/data/mysql/mysql.sock
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
default-authentication-plugin=mysql_native_password
Zabbix config:
/etc/zabbix/zabbix_server.conf:
DBHost=localhost
DBName=zabbix
DBUser=zabbix
DBPassword=**********
DBSocket=/data/mysql/mysql.sock
The local zabbix linux user can connect fine to mysql
[root@????]# su - zabbix
[zabbix@????]$ mysql -u zabbix -p zabbix
Enter password:
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 193
Server version: 8.0.29 MySQL Community Server - GPL
Copyright (c) 2000, 2022, Oracle and/or its affiliates.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> show tables;
+----------------------------+
| Tables_in_zabbix |
+----------------------------+
| acknowledges |
| actions |
I've looked in the following logs and can't find any errors.
/var/log/zabbix/zabbix_server.log
/var/log/mysqld.log
/var/log/messages
Please help me!
Comment