Mysql & Cacti Problems!

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

Moderators: Developers, Moderators

nyhusern
Posts: 17
Joined: Tue Feb 15, 2005 11:27 pm

Mysql & Cacti Problems!

Post by nyhusern »

I upgraded cacti to 8.e.f for som weeks ago, and now I get theese errors
Warning: mysql_connect(): Access denied for user: 'cactiuser@localhost' (Using password: YES) in /usr/local/share/cacti/lib/adodb/drivers/adodb-mysql.inc.php on line 339

Warning: mysql_connect(): Access denied for user: 'cactiuser@localhost' (Using password: YES) in /usr/local/share/cacti/lib/adodb/drivers/adodb-mysql.inc.php on line 339

Warning: mysql_connect(): Access denied for user: 'cactiuser@localhost' (Using password: YES) in /usr/local/share/cacti/lib/adodb/drivers/adodb-mysql.inc.php on line 339

Warning: mysql_connect(): Access denied for user: 'cactiuser@localhost' (Using password: YES) in /usr/local/share/cacti/lib/adodb/drivers/adodb-mysql.inc.php on line 339

Warning: mysql_connect(): Access denied for user: 'cactiuser@localhost' (Using password: YES) in /usr/local/share/cacti/lib/adodb/drivers/adodb-mysql.inc.php on line 339

Warning: mysql_connect(): Access denied for user: 'cactiuser@localhost' (Using password: YES) in /usr/local/share/cacti/lib/adodb/drivers/adodb-mysql.inc.php on line 339

Warning: mysql_connect(): Access denied for user: 'cactiuser@localhost' (Using password: YES) in /usr/local/share/cacti/lib/adodb/drivers/adodb-mysql.inc.php on line 339

Warning: mysql_connect(): Access denied for user: 'cactiuser@localhost' (Using password: YES) in /usr/local/share/cacti/lib/adodb/drivers/adodb-mysql.inc.php on line 339

Warning: mysql_connect(): Access denied for user: 'cactiuser@localhost' (Using password: YES) in /usr/local/share/cacti/lib/adodb/drivers/adodb-mysql.inc.php on line 339

Warning: mysql_connect(): Access denied for user: 'cactiuser@localhost' (Using password: YES) in /usr/local/share/cacti/lib/adodb/drivers/adodb-mysql.inc.php on line 339

Warning: mysql_connect(): Access denied for user: 'cactiuser@localhost' (Using password: YES) in /usr/local/share/cacti/lib/adodb/drivers/adodb-mysql.inc.php on line 339

Warning: mysql_connect(): Access denied for user: 'cactiuser@localhost' (Using password: YES) in /usr/local/share/cacti/lib/adodb/drivers/adodb-mysql.inc.php on line 339

Warning: mysql_connect(): Access denied for user: 'cactiuser@localhost' (Using password: YES) in /usr/local/share/cacti/lib/adodb/drivers/adodb-mysql.inc.php on line 339

Warning: mysql_connect(): Access denied for user: 'cactiuser@localhost' (Using password: YES) in /usr/local/share/cacti/lib/adodb/drivers/adodb-mysql.inc.php on line 339

Warning: mysql_connect(): Access denied for user: 'cactiuser@localhost' (Using password: YES) in /usr/local/share/cacti/lib/adodb/drivers/adodb-mysql.inc.php on line 339

Warning: mysql_connect(): Access denied for user: 'cactiuser@localhost' (Using password: YES) in /usr/local/share/cacti/lib/adodb/drivers/adodb-mysql.inc.php on line 339

Warning: mysql_connect(): Access denied for user: 'cactiuser@localhost' (Using password: YES) in /usr/local/share/cacti/lib/adodb/drivers/adodb-mysql.inc.php on line 339

Warning: mysql_connect(): Access denied for user: 'cactiuser@localhost' (Using password: YES) in /usr/local/share/cacti/lib/adodb/drivers/adodb-mysql.inc.php on line 339

Warning: mysql_connect(): Access denied for user: 'cactiuser@localhost' (Using password: YES) in /usr/local/share/cacti/lib/adodb/drivers/adodb-mysql.inc.php on line 339

Warning: mysql_connect(): Access denied for user: 'cactiuser@localhost' (Using password: YES) in /usr/local/share/cacti/lib/adodb/drivers/adodb-mysql.inc.php on line 339

Cannot connect to MySQL server on 'localhost'. Please make sure you have specified a valid MySQL database name in 'include/config.php'.
-
I have looked in my config.php and I dont even have a cactiuser :P
cacti should run on a other user, but when I change, i'll still get this problem.
I have never had this problem so I dunno whats wrong! Thats why I need your help :)
User avatar
egarnel
Cacti Pro User
Posts: 708
Joined: Thu Nov 21, 2002 8:55 am
Location: Austin, TX

Post by egarnel »

per the docs, it indicates that you create a cacti db and import the schema. In the process of doing so, you should have granted perms on the dabase

See items 4 & 5 on http://www.cacti.net/downloads/docs/htm ... _unix.html

cactiuser is just a suggestion, it can be anything as long as you indicate the same values in include/config.php. [mysql may puke on some special characters, though]

Bar none, Cacti has to be one of the easiest bandwidth/snmp monitoring tools to install, not to mention one of the best

Re-read the above url and follow it closely, you will have Cacti up & running in no time.
nyhusern
Posts: 17
Joined: Tue Feb 15, 2005 11:27 pm

Post by nyhusern »

I have done the installing under unix many times, but still no luck.
But I dont understand all of what you are saying egarnel, can you please try to explain one more time? It would be mostly appreciated ;)
User avatar
egarnel
Cacti Pro User
Posts: 708
Joined: Thu Nov 21, 2002 8:55 am
Location: Austin, TX

Post by egarnel »

OK,

I typically do this from a root prompt (#)
adduser cactiuser (for dir & file ownership, not db functions)

# mysql -pyour-password

now, you are in mysql as admin

Code: Select all

mysql>
mysql>create database cacti;
mysql> GRANT ALL ON cacti.* TO cactiuser@localhost IDENTIFIED BY 'somepassword';
quit;
mysql -u cactiuser -psomepassword cacti < cacti.sql
NOTE: the somepassword must be the same as above. It will fail at this step if you do not specify the db username & pass that has rights to the cacti db in mysql. DO NOT give the cactiuser rights to all the databases in mysql, just cacti

now edit the cacti/include/config.php file

Code: Select all

$database_default = "cacti";
$database_hostname = "localhost";
$database_username = "cactiuser";
$database_password = "password from step above";
That should give you everything you need to start the web install. Be sure to check the perms/ownership on the log & rra directories.

I really cannot be any more clear than that. Cacti and pretty much all other
monitoring sw requires some underlying knowledge of the web, db servers & associated sw
nyhusern
Posts: 17
Joined: Tue Feb 15, 2005 11:27 pm

Post by nyhusern »

Yeah I know, but this is the first time it dont work for me, and when that is said it still dont hehe.
And I have other programs running souch as phpBB, phpnuke and vwar and those works fine with no problems, so maybe cacti dont like FreeBSD anymore :) I dont know
alphademon
Posts: 8
Joined: Tue Jul 26, 2005 1:57 am

Post by alphademon »

try using without a password for cactiuser on mysql..
nyhusern
Posts: 17
Joined: Tue Feb 15, 2005 11:27 pm

Post by nyhusern »

Got it working again! In FreeBSD you only need to change the file db-settings.php in include/ folder. Now everything is up and running as the good old days :D
bfurner
Posts: 3
Joined: Fri Jul 29, 2005 2:38 pm

Post by bfurner »

Hmmm... I am experiencing a similar issue, but I do not find a file name db-settings.php in the include/ folder. Which version of cacti are you using?

Brian
nyhusern wrote:Got it working again! In FreeBSD you only need to change the file db-settings.php in include/ folder. Now everything is up and running as the good old days :D
Tremaine
Posts: 3
Joined: Thu Aug 04, 2005 9:20 am
Location: Calgary
Contact:

adodb-mysql line 339

Post by Tremaine »

I'm having exactly the same issue here.

Many lines of

Code: Select all

Warning: mysql_connect(): Access denied for user: 'cactiuser@localhost' (Using password: NO) in /var/www/localhost/htdocs/cacti/lib/adodb/drivers/adodb-mysql.inc.php on line 339
followed by

Code: Select all

Cannot connect to MySQL server on 'localhost'. Please make sure you have specified a valid MySQL database name in 'include/config.php'.

From config.php

Code: Select all

$database_type = "mysql";
$database_default = "cacti";
$database_hostname = "localhost";
$database_username = "cactiuser";
$database_password = "db password here";
I'm able to log into mysql at the command line with cactiuser and the db password specified in config.php

Code: Select all

 mysql -u cactiuser -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 2479 to server version: 4.0.24

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql>
Any suggestions?
nyhusern
Posts: 17
Joined: Tue Feb 15, 2005 11:27 pm

Post by nyhusern »

hmmmm. Cant find it? You've used ports right?

I am using Cacti Version 0.8.6f

Try to 'locate db-settings.php' in ssh and paste here what you find
Tremaine
Posts: 3
Joined: Thu Aug 04, 2005 9:20 am
Location: Calgary
Contact:

Post by Tremaine »

That file doesn't appear to exist. I'm using the same version as you, but it was installed from the Gentoo packages.

net-analyzer/cacti-0.8.6f-r1
nyhusern
Posts: 17
Joined: Tue Feb 15, 2005 11:27 pm

Post by nyhusern »

hmmmm. I am not used to gentoo, so I do not know then. But if gentoo does compile after downloading, and you dont have to type make, make install, configure etc. Then it should be much like BSD in order. Right after the install you should read the info, there it will be written what you need to do in the gentoo os. Good Luck ;)
Tremaine
Posts: 3
Joined: Thu Aug 04, 2005 9:20 am
Location: Calgary
Contact:

Post by Tremaine »

After some back and forth on the bug tracking list for Gentoo, I managed to determine that, at least in Gentoo, the use of the $ character is not supported for the password. Not sure if there are others, but I'm rather hoping that gets fixed as I much prefer being able to use special characters in passwords ;)

I've got the interface up and running now... now all I need to get working is the damned graphing :)
elnino
Cacti User
Posts: 205
Joined: Tue Mar 08, 2005 9:51 pm

Post by elnino »

Try disabling SELinux and then seeing if if Cacti runs. There are directions in the sticky topic in this forum. Those were the same errors I was getting with SELinux enabled
User avatar
TheWitness
Developer
Posts: 17007
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

If it's not SELINUX, then you need to verify what version of mysql you are running. If it's 4.1.x, you need to enable old password support and things will work just fine.

TheWitness
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?
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests