views:

365

answers:

2

I've just installed the latest production release of MySQL (64-bit) on my Windows 7 box. It was a straight vanilla install, using all defaults; but phpmyadmin can't see it at all. MySQL is configured as a service to start automatically, and I know it's running because the MySQL GUI tools work correctly.

The actual error message that I'm getting from phpmyadmin is:

Cannot load mysql extension. Please check your PHP configuration. - Documentation

phpinfo() shows:

> mysqlnd enabled 
> Version   mysqlnd 5.0.7-dev - 091210 - $Revision: 294543 $
> Compression supported
> Command buffer size  4096 
> Read buffer size   32768 
> Read timeout   31536000
> Collecting statistics  Yes
> Collecting memory statistics  No

Doing a netstat -a, I see

TCP    0.0.0.0:3306           Marks-Netbook:0        LISTENING

when I'd expect to see

TCP    127.0.0.1:3306         Marks-Netbook:0        LISTENING

I don't know if this is the reason phpmyadmin can't connect, but suspect that it is probably the case. Can anybody confirm whether this is the likely cause, and/or suggest how I can resolve this?

+1  A: 

Listening on 0.0.0.0 means it's listening on all interfaces, including loopback which is 127.0.0.1. So this shouldn't be a problem.

Please post your phpmyadmin config.

ZZ Coder
I'm not sure my problem is related to the config file... I've modified my original question with the message that I'm getting from phpmyadmin, which suggests something more fundametally wrong with my PHP configuration
Mark Baker
+1  A: 

Cannot load mysql extension.

There are no less than three ways to connect to MySQL from PHP:

  1. The "mysql" extension
  2. The "mysqli" extension
  3. PDO

phpMyAdmin seems to want to use the "mysql" extension. Check your php.ini, make sure that the "mysql" extension is enabled. The line will probably look something like extension=php_mysql.dll

"mysqlnd" is the Native Driver for MySQL, and is used by the extensions and PDO to actually connect.

Charles
Bingo - php loading the wrong php.ini file, and the presence of mysqlnd in the phpinfo() made me think the extension was being loaded. Now have connection via phpmyadmin thanks
Mark Baker