FATAL: Connection to Cacti database failed

Post general support questions here that do not specifically fall into the Linux or Windows categories.

Moderators: Developers, Moderators

Post Reply
FriFra
Posts: 8
Joined: Sat Jan 06, 2024 12:39 pm

FATAL: Connection to Cacti database failed

Post by FriFra »

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.
My mysql server is running on another host, but i was able to successfully create a connection to port 3306 using telnet from the exact same machine.

What can i check?

I searched this forum and found a lot of equal error messages, but none whicht helped me to solve the issue.
User avatar
TheWitness
Developer
Posts: 17047
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Re: FATAL: Connection to Cacti database failed

Post by TheWitness »

From the web server, attempt to login to the MariaDB/MySQL database directly.

Code: Select all

mysql -ucactiuser -pcactiuser -hmy-database-host -A cacti
Once you can do that, you should be able to use Cacti. Some installs of MariaDB/MySQL disable logins over anything but the local socket or localhost. Not certain that's the issue. If the login fails, you should get a message like:

User 'cactiuser@somehost' is not authorized...

So, from the database server, you do the following:

Code: Select all

GRANT ALL ON cacti.* to 'cactiuser'@'somehost' identified by 'cactiuser';
GRANT SELECT on mysql.time_zone_name to 'cactiuser'@'somehost';
That'll normally do it properly. If not, then check that networking is enabled on the database settings. These are the offending settings on the database to look out for.

Code: Select all

#skip-networking=0
#skip-bind-address
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
FriFra
Posts: 8
Joined: Sat Jan 06, 2024 12:39 pm

Re: FATAL: Connection to Cacti database failed

Post by FriFra »

Thank you. I had a typo in the password.
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests