Help please Fatal error: Call to undefined function mysql_co

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

Moderators: Developers, Moderators

Post Reply
fiacchino
Posts: 24
Joined: Fri Nov 11, 2005 3:48 pm

Help please Fatal error: Call to undefined function mysql_co

Post by fiacchino »

I am getting

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

When I try to start cacti for the first time.

I am using windows XP pro with IIS
Mysql, and net-snmp- rrdtool all work with PHP Version 5.0.5

php seems to be working something is wrong with my mysql can someone please help?
ibae
Posts: 2
Joined: Thu Nov 10, 2005 10:59 pm

Post by ibae »

mysql_connect () has been deprecated in favor of mysql_real_connect().
Please check http://mysqldatabaseadministration.blog ... ll-to.html

I encountered same error with MySQL 4.1, but when changed my MySQL to older version v4.0.12, the error disappeared.

It seems to me that newer MySQL does not recognize mysql_connect() function.
User avatar
BSOD2600
Cacti Moderator
Posts: 12171
Joined: Sat May 08, 2004 12:44 pm
Location: USA

Post by BSOD2600 »

Follow step #6 under MySQL in the guide in my signature.
achilles
Posts: 3
Joined: Mon Nov 14, 2005 12:16 pm

Call to undefined function mysql_connect()

Post by achilles »

BSOD2600 wrote:Follow step #6 under MySQL in the guide in my signature.
I am getting the same error on first attempt to use Cacti.

I've tried all the steps in your guide and checked all the config files etc.

Any more hints as to what's going on?

My specific message is:
Fatal error: Call to undefined function mysql_connect() in C:\CACTI_Monitoring\cacti-0.8.6g\lib\adodb\drivers\adodb-mysql.inc.php on line 338

I'm on a Windows 2003 server std edition with SP1, with PHP 5 and MySql5 nad latest Cacti software from the site.
User avatar
BSOD2600
Cacti Moderator
Posts: 12171
Joined: Sat May 08, 2004 12:44 pm
Location: USA

Post by BSOD2600 »

MySQL 5 is not supported with cacti yet. Please use an older version.
achilles
Posts: 3
Joined: Mon Nov 14, 2005 12:16 pm

Post by achilles »

BSOD2600 wrote:MySQL 5 is not supported with cacti yet. Please use an older version.
Removed MYsql5, installed Mysql4.1.
Applied all set up steps in your guide including the old password stuff.
I can use Mysql in DOS window as user cactiuser with password cactipw accepted OK.
BUT, still get exactly same error message from cacti in browser.

Any more help you can provide, please?
User avatar
BSOD2600
Cacti Moderator
Posts: 12171
Joined: Sat May 08, 2004 12:44 pm
Location: USA

Post by BSOD2600 »

Besides appling the old password trick, outlined in my guide (that I got from MySQL.com). Nope. That's what you need to do to make it work.

Paste the output of the following: php -m
achilles
Posts: 3
Joined: Mon Nov 14, 2005 12:16 pm

Fatal error: Call to undefined function mysql_connect()

Post by achilles »

BSOD2600 wrote:Besides appling the old password trick, outlined in my guide (that I got from MySQL.com). Nope. That's what you need to do to make it work.

Paste the output of the following: php -m
Output is:-

[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
[Zend Modules]
User avatar
BSOD2600
Cacti Moderator
Posts: 12171
Joined: Sat May 08, 2004 12:44 pm
Location: USA

Post by BSOD2600 »

Well you have the mysql module, so you must have not followed the guide (mine or the one at mysql.com) on how to get older mysql clients working with PHP. I suggest you re-read and go over the steps again.

Last resort is to use the php_mysqli.dll extention. Only works with php5.
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests