UtamaBeritaTutorialBlogTool

Cannot Load MySQL Extension

Posted By: zainal on April, 30 2007

If you are getting this error (Cannot Load MySQL Extension. Please check your PHP configuration) when running phpmyadmin with browser, you need to enable the mysql extension.

1) Edit your php.ini and make sure the following line was uncommented:

extension=php_mbstring.dll
extension=php_mysql.dll

2) Copy \PHP\libmysql.dll to the \windows\system32 if you were running mysql on windows.

3) Restart your server

You can use this simple script to test. It can tell you whether the mysql extensions is successfully loaded.

if (!@function_exists('mysql_get_server_info')) {
echo “Mysql is not loaded”;
}else{
echo “Mysql is successfully loaded”;
}

Technorati Tags: ,






7 Comments so far

  1. Harry on September 13th, 2007

    hi, i used phpMyAdmin before offline and it worked fine but now when i installed xampp again, http://localhost/phpmyadmin doesn’t work no more. the same error, “cannot load mySQL extension,” keeps showing up.

    i tried the steps in this page and i couldn’t make it work… i edited the php.ini in c:\xamp\php\ and copied the C:\xamp\PHP\libmysql.dll to C:\WINDOWS\system32\. what did i miss?

    i also checked if the mysql extension is loaded by uploading the script to mydomain but apparently is blank.

  2. Harry on September 13th, 2007

    oops!! my bad!! i just realized that i had installed php5 thus by installing xampp which also had php in it i have 2 php.ini files, i edited the php.ini in xampp/php. in short, i edited the wrong php.ini file. hehe..

  3. zainal on December 10th, 2007

    glad you found the solution

  4. sanjay on February 16th, 2008

    i have installed php5, apache and mysql.
    have configured apache to load php.

    have edited php.ini and activated libmysql.dll
    have coppied php.ini and libmysql.dll C:\WINDOWS\system32\ … and C:\WINDOWS\

    but php still not loading mysql. plse help me

  5. zainal on February 16th, 2008

    sanjay, make sure you have the extension_dir in php.ini set to the directory where the PHP extensions are located.

    For example extension_dir value for PHP5 is C:\PHP\ext

  6. Revathi on May 6th, 2008

    I installed Wampserver2.

    I got the foll error

    phpMyAdmin - Error

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

    plz help me

  7. Ganesh on July 11th, 2008

    Hi!

    After I configured with php5/mysql/iis on windows xp and typed the url localhost/phptest.php It displays the information regarding php configuration. But It won’t display the mysql information. I tried your method, It displays
    Mysql is not loaded.

    PLease advice me.

    Thanks


Leave a reply

= Please answer this math (required)