MySQL/PHP error

Post general support questions here that do not specifically fall into the Linux or Windows categories.

Moderators: Developers, Moderators

Post Reply
Kneebone

MySQL/PHP error

Post by Kneebone »

I tried to see if this had been posted before, but no joy.

Here's what I get when I try to connect to http://myserver/cacti/ :
Warning: Access denied for user: 'cactiuser@localhost' (Using password: YES) in /usr/local/cacti-0.6.8/include/database.php on line 19

Warning: MySQL Connection Failed: Access denied for user: 'cactiuser@localhost' (Using password: YES) in /usr/local/cacti-0.6.8/include/database.php on line 19
Cannot connect to MySQL server on localhost
The obvious answer is, "You fool, you need to set the proper password in your include/config.php file." In fact, this is the relevant snippet from that file:
$database_default = "cacti";
$database_hostname = "localhost";
$database_username = "cactiuser";
$database_password = "cacti";
And when I try the following, I can connect, no probs:
$ mysql -u cactiuser -pcacti
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 95 to server version: 3.23.49

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

mysql>
Now for my lame attempt at debugging it: I tried to change the value of $database_username to some other string, and when I went to reload the page, it still insists that I'm trying to connect as cactiuser. I thought that *maybe* something might have possibly been cached in Apache, so I restarted it. No effect.

Other useful info:
$ uname -a
Linux webmonk 2.4.18-3 #1 Thu Apr 18 07:37:53 EDT 2002 i686 unknown
$ cat /proc/version
Linux version 2.4.18-3 (bhcompile@daffy.perf.redhat.com) (gcc version 2.96 20000731 (Red Hat Linux 7.3 2.96-110)) #1 Thu Apr 18 07:37:53 EDT 2002
If anyone has any suggestions, let me know. :(

Kneebone
Last edited by Kneebone on Wed Aug 28, 2002 5:27 pm, edited 1 time in total.
Kneebone

Re: MySQL/PHP error

Post by Kneebone »

If nothing else, could someone point me at the piece of code which does the actual invocation of 'mysql'? I wouldn't mind having a go at tweaking it myself.

Kneebone
Kneebone

Re: MySQL/PHP error

Post by Kneebone »

Nevermind... I figured it out.

While installing cacti, the instructions were extremely light on where to install it. Initially I did set it up in /usr/local/cacti, and set up the appropriate entry in Apache. But later on (after some stumbling) it seemed that the de facto location for cacti was under /var/www/http/cacti, so that's where I moved the tree to.

Out of frustration (in trying to solve this problem) I renamed /var/www/http/cacti to /var/www/http/cacti2. Imagine my surprise when the access worked.

I scoped out /etc/httpd/conf/httpd.conf and sure enough, I'd originally set up the cacti definitions to point at /usr/local/cacti. Feh. :oops:

I made the appropriate change, restarted Apache, renamed the directory back to /var/www/http/cacti, and that fixed it! :D

I think this was one of those "I should try to get more sleep before undertaking something new" situations.

Sorry if this was a waste of bandwidth, but I hope that someone else benefits from the errors of my ways. ;)

Kneebone
raX
Lead Developer
Posts: 2243
Joined: Sat Oct 13, 2001 7:00 pm
Location: Carlisle, PA
Contact:

Post by raX »

Nope plently of bandwidth to go around :lol:

I'm sorry for not getting to your post in time though.

Like you said, hopefully someone else finds their solution here.

-Ian
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest