Can't connect to MySQL

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
Bob42
Forum Newbie
Posts: 3
Joined: Thu Jul 09, 2009 10:08 am

Can't connect to MySQL

Post by Bob42 »

After installing PHP and MySQL I can't seem to connect to the database. NavCat connections work fine as do non-database PHP web pages. I tried a mysql_connection_test.php and got the following errors indicating that it can't load the PHP mysql.dll.

PHP Warning: PHP Startup: Unable to load dynamic library './php_mysql.dll' - The specified module could not be found.
in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library './php_mysqli.dll' - The specified module could not be found.

I think that the php.ini is setup correctly. I am running XP Pro SP3.

Any help will be appreciated. Thanks, Bob
User avatar
califdon
Jack of Zircons
Posts: 4484
Joined: Thu Nov 09, 2006 8:30 pm
Location: California, USA

Re: Can't connect to MySQL

Post by califdon »

Are the files php_mysql.dll and php_mysqli.dll in the same directory as the configuration file? Probably not, so you need to find the locations of those 2 files and enter the fully qualified path in your configuration file.
joe_black
Forum Newbie
Posts: 4
Joined: Thu Jul 09, 2009 11:31 am

Re: Can't connect to MySQL

Post by joe_black »

What apache server do yo use?usually I test the apche, php and mysql use this tag: "http://localhost/" if your apache server run correctly it will redirect a pages called phpinfo. If you installing the localhost server and there`s an error, you better try to download it again, with the different web address.
mysql_connection_test.php
PHP Warning: PHP Startup: Unable to load dynamic library './php_mysql.dll' - The specified module could not be found.
in Unknown on line 0
You made the file?or it from the application and used to do the test connection?

And the last one, perhaps you should look the script from the tested file (mysql_connection_test.php) it seems looking a module to run the script, soo??try to find the file on php configuration that have permission writeable and not writeable files connected to the tested script file. If you doesnt want to bother at all, just try to find another apache server(Some are free....)
Bob42
Forum Newbie
Posts: 3
Joined: Thu Jul 09, 2009 10:08 am

Re: Can't connect to MySQL

Post by Bob42 »

Thanks all for your feedback. I think I got it fixed.

I ended up, after much frustration, reloading, recompiling, and reconfiguring PHP from scratch. Along the way I got side tracked trying to get IIS working. Apparently IIS is no longer available for XP, at least the MMC component is not. And I really did not want to load Apache.

In the event that it helps anyone I offer the following. I am using Expression Web 2 (EW) and Visual Web Developer (VWD) for my IDEs. EW seems to use its own web server which means that the php-cgi.exe had to be set in the site settings.

Getting PHP and MySQL working has been a long and extremely frustrating experience.
Post Reply