mysql_connect() error after new install

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

Moderators: Developers, Moderators

Post Reply
caustic
Posts: 8
Joined: Tue May 10, 2005 1:06 pm
Location: Ohio, US

mysql_connect() error after new install

Post by caustic »

I know this subject has been beaten to death in these forums but I'm getting an error when I first bring up the cacti main page after a new installation. I have reviewed the other postings and follwed the advice given but still have not been able to resolve this.

Fatal error: Call to undefined function mysql_connect() in C:\apache\Apache2\htdocs\cacti\lib\adodb\drivers\adodb-mysql.inc.php on line 338

I am using:
Windows Server 2003 with IIS not installed
PHP 5.0.4
RRDTool 1.0.40
Net-SNMP 5.2.1
Apache 2.0.54
cacti-0.8.6d
Mysql 4.1.11

I ran php -m and this is the result:
C:\php>php -m
[PHP Modules]
bcmath
calendar
com_dotnet
ctype
dom
ftp
iconv
libxml
mysql
odbc
pcre
session
SimpleXML
snmp
sockets
SPL
SQLite
standard
tokenizer
wddx
xml
zlib

This is what I have in my config.php:
$database_type = "mysql";
$database_default = "cacti";
$database_hostname = "192.1.12.209";
$database_username = "cactiuser";
$database_password = "cacti";

I can verify that these are the correct credentials from a cmd prompt by using: mysql --user=cactiuser --password cacti

I have rebooted a few times. I only have one php.ini file and that is located in c:\php. There is a corresponding environment variable for this directory.

Are there any other steps I can take to troubleshoot this? Anything else I can check? Any help is appreciated. Thank you.
User avatar
BSOD2600
Cacti Moderator
Posts: 12171
Joined: Sat May 08, 2004 12:44 pm
Location: USA

Post by BSOD2600 »

Since you are using mysql 4.1, I believe you must give your cactiuser the 'old password' trick.

Are you sure, you've given the proper rights for cactiuser at the host you've specified?
caustic
Posts: 8
Joined: Tue May 10, 2005 1:06 pm
Location: Ohio, US

Post by caustic »

Thanks for the reply.

I read up a bit on the "old password" posts and went back to I guess convert my passwords to the old format via the information at this link: http://dev.mysql.com/doc/mysql/en/old-client.html. After making the changes I still get the error.

If I hadn't given the proper rights would I still be able to access the database using the "mysql --user=cactiuser --password cacti" command? Are there additional rights that should be granted.

I pretty much followed the documentation for the W32 install to the letter.
caustic
Posts: 8
Joined: Tue May 10, 2005 1:06 pm
Location: Ohio, US

Post by caustic »

I did a bit more testing. It looks like when people see this error they generally assume it is a permissions issue.

So, I thought I would try plugging in root as username and set the appropriate password in the config.php file. From what I know of mysql, root should have access to everything right? So this should be an effective test to rule out permissions. I'm still getting the same error.

Is there anything else I can look at to determine the source of the problem? A path I can verify, some other test within php other than the "-m" switch?
EaRp
Posts: 2
Joined: Tue May 17, 2005 7:14 pm

Post by EaRp »

Caustic, when you set the environment variables for MIBDIRS and PHPRC did you create two new variables in the system or you just added them on the path variable?

I had the exact same error and it was because I put those two variables as a part of the path variable. I got confused with the instructions and added both variables to the path variable instead of creating two new ones, one for MIBDIRS=c:\php\mibs and another for the PHPRC=c:\php. :roll: So if you did the same thing you should remove them from the path variable and create two new ones. After I created the variables and reboot the computer, it worked just fine.

Look at the attachments[/url]
Attachments
MIBDIRS_Variable.jpg
MIBDIRS_Variable.jpg (20.67 KiB) Viewed 2899 times
PHPRC_Variable.jpg
PHPRC_Variable.jpg (24.44 KiB) Viewed 2899 times
caustic
Posts: 8
Joined: Tue May 10, 2005 1:06 pm
Location: Ohio, US

Post by caustic »

Wow, yeah that's what I did! That's probably it. I'll create those new system variables and let you know how it comes out. Thanks for the reply
caustic
Posts: 8
Joined: Tue May 10, 2005 1:06 pm
Location: Ohio, US

Post by caustic »

You have no idea how nice it is to see that first "cacti installation" page. Even if the rest of the setup goes to crap I will still savor this moment.

Thank you sir I owe you a beer.
EaRp
Posts: 2
Joined: Tue May 17, 2005 7:14 pm

Post by EaRp »

You're welcome! :wink:
Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests