Link to home
Start Free TrialLog in
Avatar of jibranilyas
jibranilyas

asked on

Cacti Installation help

I installed Cacti on ubuntu and followed all instructions very carefully from the following link
http://www.cacti.net/downloads/docs/html/install_unix.html

Now, when i go to http://localhost/cacti, i get the following error

Warning: mysql_connect() [function.mysql-connect]: Access denied for user: 'cacti@localhost.localdomain' (Using password: YES) in /usr/share/adodb/drivers/adodb-mysql.inc.php on line 338

The above line is repeated several times and the last time in that page is
Cannot connect to MySQL server on 'take3'. Please make sure you have specified a valid MySQL database name in 'include/config.php'.

I have made the changes in that config.php file and have specified databasename, username and other stuff.

When i was installing cacti. It gave me a warning for php include path change.. here is a screenshot
http://img265.imageshack.us/img265/3586/phpchangeinubuntu0ec.png   

i did edit the php.ini file in all three locations i found
/etc/php5/cli/php.ini
/etc/php5/apache2/php.ini
/etc/php4/apache2/php.ini"

Here is the change i made
Section :  Paths and Directories ;

; UNIX: "/path1:/path2"
;include_path = ".:/usr/share/adodb"   from /usr/share/php

I still get the error... Please help if you can.. Thanks,
ASKER CERTIFIED SOLUTION
Avatar of TheTull
TheTull

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of TheTull
TheTull

Also,

You could try installing an older version of MySQL
Avatar of jibranilyas

ASKER

Thanks... i will try that tomorrow :)
i tried, but it failed.

mysql> SET PASSWORD FOR 'cacti'@'localhost' = OLD_PASSWORD ('cacti');
ERROR 1064: You have an error in your SQL syntax.  Check the manual that corresponds to your MySQL server version for the right syntax to use near 'OLD_PASSWORD ('cacti')' at line 1

So, i tried the other way from your link
mysql> UPDATE mysql.user SET Password = OLD_PASSWORD('cacti') WHERE Host = 'localhost' AND User = 'cacti';
Query OK, 0 rows affected (0.13 sec)
Rows matched: 1  Changed: 0  Warnings: 0

I still get the same error ... Any ideas?
fyi

mysql> select version();
+-----------------------------+
| version()                   |
+-----------------------------+
| 4.0.24_Debian-10ubuntu2-log |
+-----------------------------+
1 row in set (0.00 sec)
i did a test like as instructed by this page
http://www.phplivesupport.com/documentation/viewarticle.php?uid=1&aid=35&pid=1

and got the following error, so i believe the whole problem is the include path. I have changed it in three locations mentioned in my first post... where else can i make that change.
Warning: Unknown: failed to open stream: Permission denied in Unknown on line 0
Warning: Unknown: Failed opening '/var/www/testdb.php' for inclusion (include_path='.:/usr/share/php:/usr/share/pear') in Unknown on line 0
I just checked my phpinfo by going to http://localhost/testphp.php

i saw the include path as something different .. i.e.
include_path      .:/usr/share/php:/usr/share/pear      .:/usr/share/php:/usr/share/pear

Where is the config file for that.... i mean, how and where can i change it from /usr/share/php to /usr/share/adodb
sql database test works now--  from http://www.phplivesupport.com/documentation/viewarticle.php?uid=1&aid=35&pid=1 
i had wrong permission on testdb.php on my webserver.

Connection:                  Successful!
Database Selection:       Successful!
Glad to see it is working, those little permissions can be a pain sometimes!
TheTull... its only the sql database test that work., I tested the database to make sure there was nothing wrong with authetication to the database

The cacti front is still the same... i get the error when i browse http://localhost/cacti/

Warning: mysql_connect() [function.mysql-connect]: Access denied for user: 'cacti@localhost.localdomain' (Using password: YES) in /usr/share/adodb/drivers/adodb-mysql.inc.php on line 338

:(

anything else i can try ?
Have you performed this command on your cacti database yet:

GRANT ALL PRIVILEGES ON database_name.* TO ‘root’ IDENTIFIED BY ‘password’;

that command gives the user (in this case root) full permissions to all database files that start with "database_name"  You would of course want to replace those names with the names of your database and user and password.

Once that command goes through, enter this command to reset the privileges:

FLUSH PRIVILEGES;

Once they are reset, try it again.  Doing those above commands using the cacti username will confirm that that user has all permissions like it should have.
Yes, I have done that
infact, i have done everything mentioned on this page
http://www.cacti.net/downloads/docs/html/install_unix.html

IT WORKS NOW

i had to edit

/etc/cacti/debian.php and add the sql authentication info

Thanks for the help