Second try of Cacti installation. Question. [SOLVED]

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

Moderators: Developers, Moderators

Post Reply
Skepticalme
Posts: 36
Joined: Thu Jan 12, 2023 11:33 pm

Second try of Cacti installation. Question. [SOLVED]

Post by Skepticalme »

Thanks for all the help so far.

Mariadb 10.3.36
Nems 1.5.2 (raspian 10)
cacti 1.2.23

Given the issues I was having, I decided to reinstall the OS and start again.

I followed this web site's instructions (exactly) for installing everything including Cacti, and didn't do anything else https://howchoo.com/pi/raspberry-pi-net ... itor-setup

When I attempt to set up Cacti I am met with a screen that says the following:

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.
The database is running, and :

Code: Select all

/opt/cacti/include/config.php
Image

Code: Select all

$ sudo mysql --version
mysql  Ver 15.1 Distrib 10.3.22-MariaDB, for debian-linux-gnueabihf (armv8l) using readline 5.2

Code: Select all

nemsadmin@nems:~ $ sudo service mysql status
● mariadb.service - MariaDB 10.3.22 database server
   Loaded: loaded (/lib/systemd/system/mariadb.service; enabled; vendor preset: enabled)
   Active: active (running) since Mon 2023-01-16 17:43:30 AEDT; 14min ago
     Docs: man:mysqld(8)
           https://mariadb.com/kb/en/library/systemd/
 Main PID: 673 (mysqld)
   Status: "Taking your SQL requests now..."
    Tasks: 31 (limit: 4035)
   Memory: 102.8M
   CGroup: /system.slice/mariadb.service
           └─673 /usr/sbin/mysqld

Jan 16 17:43:25 nems systemd[1]: Starting MariaDB 10.3.22 database server...
Jan 16 17:43:28 nems mysqld[673]: 2023-01-16 17:43:28 0 [Note] /usr/sbin/mysqld (mysqld 10.3.22-MariaDB-0+deb10u1) star
Jan 16 17:43:30 nems systemd[1]: Started MariaDB 10.3.22 database server.
Jan 16 17:43:31 nems /etc/mysql/debian-start[995]: /usr/bin/mysql_upgrade: the '--basedir' option is always ignored
Jan 16 17:43:31 nems /etc/mysql/debian-start[995]: Looking for 'mysql' as: /usr/bin/mysql
Jan 16 17:43:31 nems /etc/mysql/debian-start[995]: Looking for 'mysqlcheck' as: /usr/bin/mysqlcheck
Jan 16 17:43:31 nems /etc/mysql/debian-start[995]: Version check failed. Got the following error when calling the 'mysq
Jan 16 17:43:31 nems /etc/mysql/debian-start[995]: ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using
Jan 16 17:43:31 nems /etc/mysql/debian-start[995]: FATAL ERROR: Upgrade failed
Jan 16 17:43:31 nems /etc/mysql/debian-start[1043]: Checking for insecure root accounts.
What are some troubleshooting steps, or a website that I can follow, that can help resolve this issue?
Last edited by Skepticalme on Mon Jan 16, 2023 6:17 pm, edited 1 time in total.
User avatar
phalek
Developer
Posts: 2838
Joined: Thu Jan 31, 2008 6:39 am
Location: Kressbronn, Germany
Contact:

Re: Second try of Cacti installation. Question.

Post by phalek »

How about a

Code: Select all

sudo apt-get install php-mysql 
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
Skepticalme
Posts: 36
Joined: Thu Jan 12, 2023 11:33 pm

Re: Second try of Cacti installation. Question.

Post by Skepticalme »

phalek wrote: Mon Jan 16, 2023 3:30 am How about a

Code: Select all

sudo apt-get install php-mysql 
Thanks for the reply.

I think I've already tried that:

Code: Select all

admin@nems:~ $ sudo apt-get install php-mysql 
[sudo] password for admin: 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
php-mysql is already the newest version (2:7.3+69).
0 upgraded, 0 newly installed, 0 to remove and 303 not upgraded.
User avatar
phalek
Developer
Posts: 2838
Joined: Thu Jan 31, 2008 6:39 am
Location: Kressbronn, Germany
Contact:

Re: Second try of Cacti installation. Question.

Post by phalek »

Ok, so next is to restart the http server, then retry.

If that is not working, then you probably didn't do all steps.

Check if you did these:

Create the Cacti database:

Code: Select all

mysqladmin -u root -p create cacti
mysql -p cacti < /var/www/html/cacti/cacti.sql
Logon to the database:

Code: Select all

mysql -u root -p

Code: Select all

Create the Cacti user/password and assign appropriate access
GRANT SELECT ON mysql.time_zone_name TO cacti@localhost IDENTIFIED BY 'mypass23';
GRANT ALL ON cacti.* TO cacti@localhost IDENTIFIED BY 'mypass23';
flush privileges;
exit

Basically, check this page for more details:
https://github.com/Cacti/documentation/ ... -Debian.md
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
Skepticalme
Posts: 36
Joined: Thu Jan 12, 2023 11:33 pm

Re: Second try of Cacti installation. Question.

Post by Skepticalme »

Thanks again.

I tried the first two commands and got this result:

Code: Select all

admin@nems:~ $ mysqladmin -u root -p create cacti
Enter password: 
mysqladmin: CREATE DATABASE failed; error: 'Can't create database 'cacti'; database exists'
admin@nems:~ $ mysql -p cacti < /var/www/html/cacti/cacti.sql
bash: /var/www/html/cacti/cacti.sql: No such file or directory
User avatar
phalek
Developer
Posts: 2838
Joined: Thu Jan 31, 2008 6:39 am
Location: Kressbronn, Germany
Contact:

Re: Second try of Cacti installation. Question.

Post by phalek »

you have to change the commands/paths according to you environment...
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
Skepticalme
Posts: 36
Joined: Thu Jan 12, 2023 11:33 pm

Re: Second try of Cacti installation. Question.

Post by Skepticalme »

phalek wrote: Mon Jan 16, 2023 4:05 am Ok, so next is to restart the http server, then retry.

If that is not working, then you probably didn't do all steps.

Check if you did these:

Create the Cacti database:

Code: Select all

mysqladmin -u root -p create cacti
mysql -p cacti < /var/www/html/cacti/cacti.sql
Logon to the database:

Code: Select all

mysql -u root -p

Code: Select all

Create the Cacti user/password and assign appropriate access
GRANT SELECT ON mysql.time_zone_name TO cacti@localhost IDENTIFIED BY 'mypass23';
GRANT ALL ON cacti.* TO cacti@localhost IDENTIFIED BY 'mypass23';
flush privileges;
exit

Basically, check this page for more details:
https://github.com/Cacti/documentation/ ... -Debian.md
I tried the second part of your reply and it has worked! Thank you so much.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest