Can't Get MySQL to Work

erorr404

Member
Jun 14, 2005
76
0
0
Hi, I'm trying to set up MySQL 5.0.13 on my Windows XP system using Apache 2.0.55 server and PHP 5.0.5.
I configured PHP to work with Apache, but it doesn't seem to detect MySQL. When I access the phpinfo.php page MySQL isn't in the list, and when I open phpMyAdmin, it tells me it "cannot load mysql extension."

On the official PHP (http://www.php.net/mysql) it gives the following configuration instructions for MySQL and PHP 5+:
MySQL is no longer enabled by default, so the php_mysql.dll DLL must be enabled inside of php.ini. Also, PHP needs access to the MySQL client library. A file named libmysql.dll is included in the Windows PHP distribution and in order for PHP to talk to MySQL this file needs to be available to the Windows systems PATH. See the FAQ titled "How do I add my PHP directory to the PATH on Windows" for information on how to do this. Although copying libmysql.dll to the Windows system directory also works (because the system directory is by default in the system's PATH), it's not recommended.

As with enabling any PHP extension (such as php_mysql.dll), the PHP directive extension_dir should be set to the directory where the PHP extensions are located. See also the Manual Windows Installation Instructions. An example extension_dir value for PHP 5 is c:\php\ext
So I follow their advice and set extension_dir = C:/www/php/ext/ (where php_mysql.dll is located) and copy "libmysql.dll" into the Windows folder, but the server still doesn't seem to recognize MySQL (it's not in phpinfo.php and phpMyAdmin gives me the error).

Can anyone help me get MySQL working? Thanks in advance!
 

itachi

Senior member
Aug 17, 2004
390
0
0
1. unless it explicitly says that mysql 5.0 is supported, use 4.1. even if its not, use 4.1.. 5.0 is still in the beta stage.
2. read over your log files.. if there's a problem loading a dll, the logs will let you know.
 

stndn

Golden Member
Mar 10, 2001
1,886
0
0
1. PHP5 binary package does not come with the DLL for mySQL support. So you have to download the zip version, extract the required DLL(s), and copy them to the PHP extension directory (usually C:\php\extensions\).

2. In your 'php.ini' file, make sure you add the extension to mysql.


I don't have PHP5 installed at home (still use PHP 4.x and mysql 4.1), so I can't check and verify. But as far as my memory serves, that's how I got it set up and working at my work computer.

Also, like itachi said, checking your apache's error log might give you a clue as to what happened.
 

erorr404

Member
Jun 14, 2005
76
0
0
In the log the only errors I get are these, except from all the websites I've visited:
[Thu Oct 20 23:55:29 2005] [error] [client 127.0.0.1] File does not exist: C:/www/webroot/RealMedia, referer: http://forums.anandtech.com/categories.aspx?catid=33
Why would it give me an error anyway, if PHP is working fine with Apache? Only MySQL doesn't work.

stndn, I have the .zip package installed, not the windows installer. The .dll's automatically went into my ext/ directory when I extracted so they're all there. I also tried adding the PECL extensions from the PHP site but that didn't do anything.

What do you mean add the extension to MySQL? I did this in my php.ini... extension_dir = "C:\www\php\ext\"
 
sale-70-410-exam    | Exam-200-125-pdf    | we-sale-70-410-exam    | hot-sale-70-410-exam    | Latest-exam-700-603-Dumps    | Dumps-98-363-exams-date    | Certs-200-125-date    | Dumps-300-075-exams-date    | hot-sale-book-C8010-726-book    | Hot-Sale-200-310-Exam    | Exam-Description-200-310-dumps?    | hot-sale-book-200-125-book    | Latest-Updated-300-209-Exam    | Dumps-210-260-exams-date    | Download-200-125-Exam-PDF    | Exam-Description-300-101-dumps    | Certs-300-101-date    | Hot-Sale-300-075-Exam    | Latest-exam-200-125-Dumps    | Exam-Description-200-125-dumps    | Latest-Updated-300-075-Exam    | hot-sale-book-210-260-book    | Dumps-200-901-exams-date    | Certs-200-901-date    | Latest-exam-1Z0-062-Dumps    | Hot-Sale-1Z0-062-Exam    | Certs-CSSLP-date    | 100%-Pass-70-383-Exams    | Latest-JN0-360-real-exam-questions    | 100%-Pass-4A0-100-Real-Exam-Questions    | Dumps-300-135-exams-date    | Passed-200-105-Tech-Exams    | Latest-Updated-200-310-Exam    | Download-300-070-Exam-PDF    | Hot-Sale-JN0-360-Exam    | 100%-Pass-JN0-360-Exams    | 100%-Pass-JN0-360-Real-Exam-Questions    | Dumps-JN0-360-exams-date    | Exam-Description-1Z0-876-dumps    | Latest-exam-1Z0-876-Dumps    | Dumps-HPE0-Y53-exams-date    | 2017-Latest-HPE0-Y53-Exam    | 100%-Pass-HPE0-Y53-Real-Exam-Questions    | Pass-4A0-100-Exam    | Latest-4A0-100-Questions    | Dumps-98-365-exams-date    | 2017-Latest-98-365-Exam    | 100%-Pass-VCS-254-Exams    | 2017-Latest-VCS-273-Exam    | Dumps-200-355-exams-date    | 2017-Latest-300-320-Exam    | Pass-300-101-Exam    | 100%-Pass-300-115-Exams    |
http://www.portvapes.co.uk/    | http://www.portvapes.co.uk/    |