Get Mysql error when connecting to Cacti web front-end

Post support questions that relate to the Windows 2003/2000/XP operating systems.

Moderators: Developers, Moderators

Post Reply
smilerza
Posts: 21
Joined: Thu Jul 07, 2005 9:47 am

Get Mysql error when connecting to Cacti web front-end

Post by smilerza »

Ok, I have a very strange problem...

Cacti was working perfectly for the last 3 months or so on our Windows 2003 SP1 Server until this afternoon.. No changes were made to the server that I know of. When trying to view graphs I get the following error message:

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

Strange thing is that I know the Mysql DB is working as I can connect to Cacti DB using the info within config.php using the non standard port and also the scheduled task ( C:\php\php-win.exe C:\Inetpub\wwwroot\Cacti\poller.php) still runs successfully. I can see the .rra's are being updated by the file timestamps and can see mysql is being updated by the select from the poller_time table:

mysql> select * from poller_time;
+----+-----------+---------------------+---------------------+
| id | poller_id | start_time | end_time |
+----+-----------+---------------------+---------------------+
| 1 | 0 | 2006-06-01 22:09:04 | 2006-06-01 22:09:04 |
| 2 | 0 | 2006-06-01 22:09:12 | 2006-06-01 22:09:12 |
| 3 | 0 | 2006-06-01 22:09:12 | 2006-06-01 22:09:12 |
| 4 | 0 | 2006-06-01 22:09:44 | 2006-06-01 22:09:44 |
+----+-----------+---------------------+---------------------+
4 rows in set (0.00 sec)

mysql>

In a nut shell I cannot access the web front-end of Cacti to view any graphs or do any admin. Seems that the IIS front-end is a little confused.

Running:

Mysql 4.1.5
PHP 5.1.2
rrdtool-cygwin-1.2.12
W2K3 SP1

Any suggestions?
User avatar
BSOD2600
Cacti Moderator
Posts: 12171
Joined: Sat May 08, 2004 12:44 pm
Location: USA

Post by BSOD2600 »

Odd.

What cacti version? Have you installed all of the patches?
How did you verify the username/password/port you're using works to connect to the mysql database?
Sure no firewall / AV was enabled which blocked the port?
smilerza
Posts: 21
Joined: Thu Jul 07, 2005 9:47 am

Post by smilerza »

Cacti version 0.8.6g - no patches installed as all was working - was about to move to 0.8.6h when this issue arose.

Verified username/password by using the following to connect to DB:

mysql -P 3305 --user=cacti --password cacti

Port isn't blocked as I can connect using the above; can see the mysql port is open by doing a netstat -an & can do a telnet 3305.

RRA files are updated every 5mins as per schedule so something is working but not the front-end. Hence the reason why I think IIS/PHP is causing some issues.

Mysql; Cacti; IIS all on the same server

How can I debug PHP/IIS as to why it can't connect to mysql via http?
User avatar
BSOD2600
Cacti Moderator
Posts: 12171
Joined: Sat May 08, 2004 12:44 pm
Location: USA

Post by BSOD2600 »

Maybe if you enabled the logging stuff in php.ini it would shed some light on whats happening. Another tool that might be handy is sysinternals.com filemon.
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests