mysql_connect() error after new install
Moderators: Developers, Moderators
mysql_connect() error after new install
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.
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.
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?
Are you sure, you've given the proper rights for cactiuser at the host you've specified?
| Scripts: Monitor processes | RFC1213 MIB | DOCSIS Stats | Dell PowerEdge | Speedfan | APC UPS | DOCSIS CMTS | 3ware | Motorola Canopy |
| Guides: Windows Install | [HOWTO] Debug Windows NTFS permission problems |
| Tools: Windows All-in-one Installer |
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.
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.
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?
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?
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. 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]
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. 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 (20.67 KiB) Viewed 2899 times
-
- PHPRC_Variable.jpg (24.44 KiB) Viewed 2899 times
Who is online
Users browsing this forum: No registered users and 3 guests