mysql_pconnect and adodb-mysql.inc.php on line 355

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

Moderators: Developers, Moderators

boby
Posts: 1
Joined: Sun Feb 26, 2006 8:18 pm

mysql_pconnect and adodb-mysql.inc.php on line 355

Post by boby »

I installed cacti with php 5 and mysql 5 with dll extensions.

For this moment, I get nothing except the following error :
Fatal error: Call to undefined function mysql_pconnect() in \lib\adodb\drivers\adodb-mysql.inc.php on line 355

I checked extensions with php -m and mysql, mysqli, snmp, sockets are loaded.

And with other post, I did the trick with old_password.

Thanks in advance for your help :)
User avatar
BSOD2600
Cacti Moderator
Posts: 12171
Joined: Sat May 08, 2004 12:44 pm
Location: USA

Post by BSOD2600 »

1) You did the old password trick and you're still getting the error?
2) You sure you enabled old-passwords when mysql wasnt running?
3) Did you update the password AFTER you enabled old-passwords?
4) Restarted the computer?
jdg
Posts: 15
Joined: Sat Mar 04, 2006 2:11 pm

Post by jdg »

I'm in the same boat here ... replied to the other thread on this topic. Did not reboot, but restarted MySql. :(
jdg
Posts: 15
Joined: Sat Mar 04, 2006 2:11 pm

Post by jdg »

Okay ... rebooted a few times and no go ... tryied logging on to mysql from the shell just to make sure the user and password were correct and they were. I don't see any 'rejections' in the MySQL logs -- maybe I'm looking in the wrong place though or don't have the proper debug level(s) defined. Filemon doesn't show any denys either. Here are the specs:

Operating System: Win2k3 Server SP1 Patched
Webserver: IIS6.0 Patched
Cacti: latest (h) Patched
Cactid: latest
MySQL: latest v5
PHP: latest v5
RRDTool: latest
Net-SNMP: latest
Cygwin: lastest

Basically, everything was downloaded either last night or this morning. :(

I even tried using the root user in config.php (after giving it an OLD_PASSWORD too) and no go. What am I missing? I've gone over the guide probably a dozen times and I'm completely stumped.

Thanks in advance.
User avatar
BSOD2600
Cacti Moderator
Posts: 12171
Joined: Sat May 08, 2004 12:44 pm
Location: USA

Post by BSOD2600 »

So you did the following?

1. Stop the MySQL service, edit your c:\mysql\my.ini file, and add the following:

#Use old password encryption method (needed for 4.0 and older clients).
old-passwords

2. Start the MySQL service.
3. You will also need to update the cactiuser account with the old password style:

shell> UPDATE mysql.user SET Password = OLD_PASSWORD('cactipw') WHERE Host = 'localhost' AND User = 'cactiuser';
mysql> FLUSH PRIVILEGES;
jdg
Posts: 15
Joined: Sat Mar 04, 2006 2:11 pm

Post by jdg »

BSOD2600 wrote:So you did the following?

1. Stop the MySQL service, edit your c:\mysql\my.ini file, and add the following:

#Use old password encryption method (needed for 4.0 and older clients).
old-passwords

2. Start the MySQL service.
3. You will also need to update the cactiuser account with the old password style:

shell> UPDATE mysql.user SET Password = OLD_PASSWORD('cactipw') WHERE Host = 'localhost' AND User = 'cactiuser';
mysql> FLUSH PRIVILEGES;
Correct; all done ... and if I load up mysqladministrator, it shows that 'Old passwords' mode is checked on.

I also did it for 'root' just in case. I also did the following command to make sure I did it correctly.

SELECT Host, User, Password FROM mysql.user
-> WHERE LENGTH(Password) > 16;

Results were 0 matches ... sooo ... :cry:
jdg
Posts: 15
Joined: Sat Mar 04, 2006 2:11 pm

Post by jdg »

Is there a way to test solely the authentication? It seems to me that the code being referenced is just trying to connect to MySQL and it is failing for some reason. While this is normally due to 'Old Passwords', it could very well be due to something else.

It looks like the user information being used is that found in ./include/config.php, is that correct?

If I use that user information to logon via mysql --user=cactiuser --password cacti, I am able to logon to do SELECT's, etc without issue.

Could there be something else preventing communication from IIS via the Script/PHP to MySQL? Is there some test script that can be used solely for checking the authentication methods/etc?

Filemon indicates no 'denied' messages.

Can PHP be run in interactive mode? If so, what commands would I use to test this connection state to MySQL? If someone has a PHP script that we can load on IIS as well to test that component, that would be wonderful.

Of course, if we're all stumped, I'm willing to give someone remote access to the box for the purpose of helping me diagnose the issues. ;)

Thoughts? Thanks in advance!

-jdg
jdg
Posts: 15
Joined: Sat Mar 04, 2006 2:11 pm

Post by jdg »

Okay ... I got irritated and performed the following steps:

Add/Remove Programs: Uninstall MySQL v5.0.18
Delete c:\mysql

Download MySQL v4.1.18
Install MySQL v4.1.18 following BSOD2600's guide.
Configure MySQL v4.1.18 also as per BSOD2600's guide.
Old-Passwords Activated and cactiuser password reset.

Ran the following:

SELECT Host, User, Password FROM mysql.user WHERE Length(Password) > 16;

Query Returned 1 Row, for user 'root'.

--> BSOD2600 : Maybe you could add the above to the FAQ to verify that step? I pulled that right from http://dev.mysql.com/doc/refman/5.0/en/old-client.html ;)

Attempted to connect to Cacti:

http://localhost:8082/cacti

Same Error (Blah Blah Line 355)

I am currently in the process of a reboot to see if that resets anything odd, though the MySQL Services were restarted after the old-password configuration and the Path was verified as containing c:\mysql\bin.

More to come ...
jdg
Posts: 15
Joined: Sat Mar 04, 2006 2:11 pm

Post by jdg »

And ... the envelope please ...
Fatal error: Call to undefined function mysql_pconnect() in c:\Inetpub\wwwroot\cacti\lib\adodb\drivers\adodb-mysql.inc.php on line 355
Sooo ... it wasn't a MySQL v5.x problem ...

It doesn't look like it's an OLD_Password problem either ... something tells me that the script simply isn't talking to the MySQL instance ... the questions are: Why? How to we verify? and how to we fix? :(

Here's my config.php
/* make sure these values refect your actual database/host/user/password */
$database_type = "mysql";
$database_default = "cacti";
$database_hostname = "localhost";
$database_username = "cactiuser";
$database_password = "cactipw";
$database_port = "3306";

/* ----- you probably do not need to change anything below this line ----- */
And if you telnet to :3306, you get a response, so I know the server is listening and accepting local connection attempts.
jdg
Posts: 15
Joined: Sat Mar 04, 2006 2:11 pm

Post by jdg »

Okay! I think I solved some problems and created more! Yeehaw! Progress is progress though, right? ;)

Okay, a few things:

(1) I had so many things scribbled on the copy of BSOD2600's installer notes that I decided to print another copy. When I went through the new copy, I found something I missed:
Under the PHP Configuration:
Add System Environment Variabel for PHPRC=c:\php
For some reason, it got chopped off the original printout.

---> BSOD2600 : Perhaps you can newline it or something?

(2) I was getting IIS Worker Thread closures on Windows 2003 Server. I couldn't nail them down, but I was getting all sorts of access and invalid fork errors in the PHP scripts. Finally, during one reboot, I got a PopUp from something called DTE (I think). It allowed me to reconfigure to protect against all things except what I exclude. I close the IIS Worker Process. After I rebooted again, no more Stop Errors and the fork/script errors disappeared.

(3) I was getting no graphs, but data was collecting properly and the files in /rra and /log were updating. It finally clicked:
The documentation says to give the IIS_WPG user access to cacti/log and cacti/rrd. I created a cacti/rrd directory during that step and gave it access. It seems there is no need for cacti/rrd ... everything is under cacti/rra.
---> BSOD2600 : Perhaps this can be tweaked as well?

Now, the new problems I'm having are related to certain devices. Layer3 Switches specifically (Extreme, Nortel, etc). When I add them using the generic SNMP probe, most return 0 interfaces (probably because they have 1000+). Is this a limitation of Cacti? Also, on the smaller switches, they'll show the ports described correctly but when I add graphs for them I get all sorts of | query_this | and |query_that | in their names.

Also, the Legend/Summary under the RRD Graphs is blank. I just show little dots like '-' right before you'd expect text saying This Color is This and This Color is That.

Also, is there a way to do WithPeak[] like in MRTG?

Pfew ...

Hope this helps some folks. ;)
User avatar
BSOD2600
Cacti Moderator
Posts: 12171
Joined: Sat May 08, 2004 12:44 pm
Location: USA

Post by BSOD2600 »

Glad you got it working.

As for the guide, I've updated the changes you've suggested. The /cacti/rrd is simply a typo. without looking at my cacti installation, I forget if its /rra or /rrd. RRDTool creates .rrd files in the /rra directory... nice and straight forward ;-)


As for the problems you're having, its likely related to PHP timing out when fetching all the interfaces. You're on Cacti 0.8.6h right? If you set the devices to use SNMP v2, cacti will use bulkget/walks which should speed up the process. You also should increase your php timeout in your php.ini file.

Your lack of graph text is likely because you didn't specify a font file in your rrdtool font path in cacti. If some graphs have text while others do not, then you are experianing a common rrdtool bug.

Withpeak sounds like it increases the history of the data stored? Might want to look at this guide: http://forums.cacti.net/viewtopic.php?t=11425
jdg
Posts: 15
Joined: Sat Mar 04, 2006 2:11 pm

Post by jdg »

Very cool! Thank you! I'll check it out ... I'll let you know what happens with the timeout changes. Hopefully that will be enough. Maybe SNMPv2 will take care of the interface query issues too.

Thanks a lot! ;)
joex51
Posts: 32
Joined: Sun Mar 05, 2006 4:05 am
Location: Connecticut

Post by joex51 »

Fatal error: Call to undefined function mysql_pconnect() in C:\Inetpub\wwwroot\cacti\lib\adodb\drivers\adodb-mysql.inc.php on line 355

This is all I get after i install I have tried everything in this thread.
my set up is
windows 2003 Svr.SP1
Cacti0.8.h fully patched
Mysql 5.0
PHP5

Any Suggestions would help imensely
ihyln
Posts: 20
Joined: Mon Mar 06, 2006 9:47 pm

Post by ihyln »

my honest advice is to use MySQL 4.0 if you can. I have the same exact setup as you and things were a lot easier once I went to 4.0.
User avatar
BSOD2600
Cacti Moderator
Posts: 12171
Joined: Sat May 08, 2004 12:44 pm
Location: USA

Post by BSOD2600 »

In updating some documentation, I did a clean install of win2k3 and cacti this evening. Used PHP 5.1.2 and MySQL 5.0.18. Followed the old-password stuff and cacti worked flawlessly on the first try. IMO, you really need to follow the instructions to the letter to get it working....
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest