[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1558
  • Last Modified:

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,
0
jibranilyas
Asked:
jibranilyas
  • 9
  • 4
1 Solution
 
TheTullCommented:
Well, it's clear that the MYSQL extention can't authenticate to the database.

From my experiences working with MYSQL and PHP, I would often receive that error when using MYSQL 5.0

This is because of a new password format used by MySQL 5.0, so, in order to fix the problem, I would have to open a MySQL prompt and enter the following command:

SET PASSWORD FOR 'some_user'@'some_host' = OLD_PASSWORD('newpwd');

This changes that account to use the OLD PASSWORD format,

The following link will explain it more:

http://dev.mysql.com/doc/refman/5.0/en/old-client.html 

hope it helps.
0
 
TheTullCommented:
Also,

You could try installing an older version of MySQL
0
 
jibranilyasAuthor Commented:
Thanks... i will try that tomorrow :)
0
Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

 
jibranilyasAuthor Commented:
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?
0
 
jibranilyasAuthor Commented:
fyi

mysql> select version();
+-----------------------------+
| version()                   |
+-----------------------------+
| 4.0.24_Debian-10ubuntu2-log |
+-----------------------------+
1 row in set (0.00 sec)
0
 
jibranilyasAuthor Commented:
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
0
 
jibranilyasAuthor Commented:
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
0
 
jibranilyasAuthor Commented:
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!
0
 
TheTullCommented:
Glad to see it is working, those little permissions can be a pain sometimes!
0
 
jibranilyasAuthor Commented:
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 ?
0
 
TheTullCommented:
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.
0
 
jibranilyasAuthor Commented:
Yes, I have done that
infact, i have done everything mentioned on this page
http://www.cacti.net/downloads/docs/html/install_unix.html

0
 
jibranilyasAuthor Commented:
IT WORKS NOW

i had to edit

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

Thanks for the help
0

Featured Post

Configuration Guide and Best Practices

Read the guide to learn how to orchestrate Data ONTAP, create application-consistent backups and enable fast recovery from NetApp storage snapshots. Version 9.5 also contains performance and scalability enhancements to meet the needs of the largest enterprise environments.

  • 9
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now