FATAL: Connection to Cacti database failed.

Post support questions that directly relate to Linux/Unix operating systems.

Moderators: Developers, Moderators

Post Reply
egislard
Posts: 3
Joined: Wed Dec 23, 2020 6:59 am

FATAL: Connection to Cacti database failed.

Post by egislard »

Hello,

I'm a french student in a internship and i try to install on a VM on Proxmox. But after trying to install cacti using different link:
https://www.centlinux.com/2020/06/insta ... tos-8.html
https://www.howtoforge.com/how-to-insta ... -centos-8/
https://computingforgeeks.com/how-to-in ... -centos-8/

I have the following error :

Code: Select all

FATAL: Connection to Cacti database failed. Please ensure:

the PHP MySQL module is installed and enabled.
the database is running.
the credentials in config.php are valid.
I have tried different configurations offered on other forums without success, can you help me?

Php version :

Code: Select all

php -v
PHP 7.2.24 (cli) (built: Oct 22 2019 08:28:36) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
MariaDB version :

Code: Select all

[root@Supervisiontest ~]# mysql -v -p
Enter password: 
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 142
Server version: 10.3.17-MariaDB MariaDB Server
I can enter in my MariaDB :

Code: Select all

[root@Supervisiontest ~]# mysql -u root -p
Enter password: 
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 132
Server version: 10.3.17-MariaDB MariaDB Server

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> 
My mariadb-server.cnf :

Code: Select all

[root@Supervisiontest ~]# cat /etc/my.cnf.d/mariadb-server.cnf 
#
# These groups are read by MariaDB server.
# Use it for options that only the server (but not clients) should see
#
# See the examples of server my.cnf files in /usr/share/mysql/
#

# this is read by the standalone daemon and embedded servers
[server]

# this is only for the mysqld standalone daemon
# 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 mysqld/mariadb according to the
# instructions in http://fedoraproject.org/wiki/Systemd
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
log-error=/var/log/mariadb/mariadb.log
pid-file=/run/mariadb/mariadb.pid
character-set-server=utf8mb4
collation-server=utf8mb4_unicode_ci
max_heap_table_size=64M
tmp_table_size=64M
join_buffer_size=64M
innodb_buffer_pool_size=512M
innodb_doublewrite=OFF
innodb_flush_log_at_timeout=3
innodb_read_io_threads=32
innodb_write_io_threads=16
innodb_buffer_pool_instances=5

#
# * Galera-related settings
#
[galera]
# Mandatory settings
#wsrep_on=ON
#wsrep_provider=
#wsrep_cluster_address=
#binlog_format=row
#default_storage_engine=InnoDB
#innodb_autoinc_lock_mode=2
#
# Allow server to accept connections on all interfaces.
#
#bind-address=0.0.0.0
#
# Optional setting
#wsrep_slave_threads=1
#innodb_flush_log_at_trx_commit=0

# this is only for embedded server
[embedded]

# This group is only read by MariaDB servers, not by MySQL.
# If you use the same .cnf file for MySQL and MariaDB,
# you can put MariaDB-only options here
[mariadb]

# This group is only read by MariaDB-10.3 servers.
# If you use the same .cnf file for MariaDB of different versions,
# use this group for options that older servers don't understand
[mariadb-10.3]
Cacti version:

Code: Select all

[root@Supervisiontest ~]# rpm -qi cacti
Name        : cacti
Version     : 1.2.15
Release     : 1.el8
Architecture: noarch
Install Date: Wed 23 Dec 2020 11:29:50 AM CET
Group       : Unspecified
Size        : 69158513
License     : GPLv2+
Signature   : RSA/SHA256, Tue 03 Nov 2020 04:03:52 PM CET, Key ID 21ea45ab2f86d6a1
Source RPM  : cacti-1.2.15-1.el8.src.rpm
Build Date  : Tue 03 Nov 2020 12:05:14 PM CET
Build Host  : buildvm-s390x-21.s390.fedoraproject.org
Relocations : (not relocatable)
Packager    : Fedora Project
Vendor      : Fedora Project
URL         : https://www.cacti.net/
Bug URL     : https://bugz.fedoraproject.org/cacti
Summary     : An rrd based graphing tool
Description :
Cacti is a complete frontend to RRDTool. It stores all of the
necessary information to create graphs and populate them with
data in a MySQL database. The frontend is completely PHP
driven.
I don't know where I am wrong. if you can help me i would appreciate it, thanks in advance for your help

Egislard
User avatar
macan
Cacti Guru User
Posts: 1106
Joined: Tue Mar 18, 2008 2:30 am
Location: Czech

Re: FATAL: Connection to Cacti database failed.

Post by macan »

your installation/include/config.php - have you right mysql credentials here?
Let the Cacti grow!
egislard
Posts: 3
Joined: Wed Dec 23, 2020 6:59 am

Re: FATAL: Connection to Cacti database failed.

Post by egislard »

Heelo,

Thanks for you answers, here my file :

Code: Select all

SUPPR
And when i create my user i do with the same password :

Code: Select all

GRANT ALL ON cacti.* TO 'cacti'@'localhost' IDENTIFIED BY 'attila';
Last edited by egislard on Wed Dec 23, 2020 10:29 am, edited 1 time in total.
egislard
Posts: 3
Joined: Wed Dec 23, 2020 6:59 am

Re: FATAL: Connection to Cacti database failed.

Post by egislard »

I resolved my problem thanks to this link : https://www.itzgeek.com/how-tos/linux/c ... hel-8.html
But i don't see the differences, so i don't where is my mistake, i'm going to investigate.

Thanks
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests