can not access cacti

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

Moderators: Developers, Moderators

Post Reply
minhnh
Posts: 8
Joined: Thu Dec 14, 2017 11:39 pm

can not access cacti

Post by minhnh »

FATAL: Connection to Cacti database failed. Please ensure the database is running and your credentials in config.php are valid.
User avatar
phalek
Developer
Posts: 2838
Joined: Thu Jan 31, 2008 6:39 am
Location: Kressbronn, Germany
Contact:

Re: can not access cacti

Post by phalek »

Well, did you check this ?

Code: Select all

Please ensure the database is running and your credentials in config.php are valid.
Greetings,
Phalek
---
Need more help ? Read the Cacti documentation or my new Cacti 1.x Book
Need on-site support ? Look here Cacti Workshop
Need professional Cacti support ? Look here CereusService
---
Plugins : CereusReporting
netniV
Cacti Guru User
Posts: 3441
Joined: Sun Aug 27, 2017 12:05 am

Re: can not access cacti

Post by netniV »

As phalek said, check as mentioned that the configuration file exists and has valid credentials.

If you can see everything looks OK there, check that you can connect using the command line to the database.

For example, using mysql this would be something like:
mysql -u <mysql_user> -p <mysql_database>

This will then prompt you for the password. Once entered, you should end up with a mysql> prompt.

Assuming that works, try issuing a command such as SHOW TABLES;
Cacti Developer & Release Manager
The Cacti Group

Director
BV IT Solutions Ltd

+--------------------------------------------------------------------------+

Cacti Resources:
Cacti Website (including releases)
Cacti Issues
Cacti Development Releases
Cacti Development Documentation
minhnh
Posts: 8
Joined: Thu Dec 14, 2017 11:39 pm

Re: can not access cacti

Post by minhnh »

Thank you everyone,
I can access database

I am newbie
Please help me

Can you give to mysql parameter config?

Thank you very much
amazen123
Posts: 43
Joined: Wed Oct 26, 2016 3:30 am

Re: can not access cacti

Post by amazen123 »

minhnh wrote:Thank you everyone,
I can access database

I am newbie
Please help me

Can you give to mysql parameter config?

Thank you very much
You can see the recommended parameters during installation of cacti.
So you need to add or change it in my.cnf.
netniV
Cacti Guru User
Posts: 3441
Joined: Sun Aug 27, 2017 12:05 am

Re: can not access cacti

Post by netniV »

If you know the credentials for your cacti database, not the superuser/root pasword, these can be entered into config.php. However, you should also make sure that you have PHP's PDO libraries installed because MySQL connectivity changed to use the PDO system in version 1.x.

On ubuntu/debian, you would do this by install php-pdo, then you may have the enable it

Code: Select all

apt install php-pdo
phpenmod pdo
If phpenmod gives an error, try php5enmod as I think older versions of php used that.
Cacti Developer & Release Manager
The Cacti Group

Director
BV IT Solutions Ltd

+--------------------------------------------------------------------------+

Cacti Resources:
Cacti Website (including releases)
Cacti Issues
Cacti Development Releases
Cacti Development Documentation
paulgevers
Cacti Pro User
Posts: 613
Joined: Tue Aug 29, 2006 4:09 pm
Location: NL

Re: can not access cacti

Post by paulgevers »

netniV wrote:On ubuntu/debian, you would do this by install php-pdo, then you may have the enable it

Code: Select all

apt install php-pdo
phpenmod pdo
Interesting, I can't find the package¹. I think you get it by installing php-mysql (which is a dependency of the Cacti package in Debian).

¹ https://packages.debian.org/search?keywords=php-dpo
Maintainer of cacti in Debian (and Ubuntu).
Cacti 1.* is now officially supported on Debian Stretch via Debian backports
FAQ Ubuntu and Debian differences
Generic cacti debugging
netniV
Cacti Guru User
Posts: 3441
Joined: Sun Aug 27, 2017 12:05 am

Re: can not access cacti

Post by netniV »

Sorry, you would be correct. I was away from a ubuntu machine at the time. I just tried to install use that above command and it's actually a virtual package supplied when you install PHP itself. So it may just be that they need to enable the PDO mod as it should already be installed.

Code: Select all

Package php-pdo is a virtual package provided by:
  php7.0-common 7.0.22-0ubuntu0.17.04.1
  php7.1-common 7.1.11-0ubuntu0.17.10.1
You should explicitly select one to install.
I believe that 7.0 is the zesty (17.04) version and 7.1 is the artful version. I still swear my ubuntu's upgrade went screwy as I wouldn't expect to see both! Not sure if the same applies to Debian as I don't have a machine with that installed. I'll defer to your expertise on that one :)
Cacti Developer & Release Manager
The Cacti Group

Director
BV IT Solutions Ltd

+--------------------------------------------------------------------------+

Cacti Resources:
Cacti Website (including releases)
Cacti Issues
Cacti Development Releases
Cacti Development Documentation
minhnh
Posts: 8
Joined: Thu Dec 14, 2017 11:39 pm

Re: can not access cacti

Post by minhnh »

Thank you every one
i solved that
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest