Apr 18, 2013
kalpesh

pdo_mysql extension is not installed

PHP Mysql Error: pdo_mysql extension is not installed.

Magento needs PDO Mysql extension for database connection and related things, so if you don’t have pdo_mysql extension enabled Magento will complain about this and will not proceed further installation. If you are not sure what PDO is, it’s high time for you to look at http://php.net/manual/en/ref.pdo-mysql.php

Coming back to error, to resolve this you will need to edit your php.ini file where it says:
;extension=pdo_mysql.so

Just uncomment the line by removing front semincolon, so it becomes
extension=pdo_mysql.so

Save it and restart the server, the error should go.

If you are on Windows, then that line should read:

extension=php_pdo_mysql.dll

If you don’t find pdo_mysql in php.ini, install php5-mysql by running the command:

sudo apt-get install php5-mysql (on Ubuntu)

sudo yum install php-mysql (on Redhat, Fedora, CentOS)

6 Comments

  • hello kalpesh,

    i am magento developer. i am not working t-shirt design module. you are working t-shirt design module…share your customization tutorials in this blog….i am your best friends

  • Thanks but the line:

    ;extension=pdo_mysql.so

    Does not exist in php.ini. I’m using the sample php.ini file created by Magento.

  • Awesome! Worked when using Amazon EC2 to connect to Amazon RDS hosted DB. :)
    Thank you for the short and sweet solution! :)
    Email me if you want to do some work together in California!

  • Hello Kalpesh,

    I need to tell to you that I have these lines in my php.ini

    [Pdo_mysql]
    ; If mysqlnd is used: Number of cache slots for the internal result set cache
    ; http://php.net/pdo_mysql.cache_size
    pdo_mysql.cache_size=2000

    ; Default socket name for local MySQL connects. If empty, uses the built-in
    ; MySQL defaults.
    ; http://php.net/pdo_mysql.default-socket
    pdo_mysql.default_socket=

    extension=php_pdo_mysql.dll

    but not pdo_mysql.so as you are telling. What should I do?

    Thanks :)

    • Hi, on a windows server PHP extensions ends in dll, so you are good with that. Check if PDO Mysql is showing in phpinfo(); output to make sure it’s working. You can also see which extensions are loaded with get_loaded_extensions function.

  • Hello
    I have a problem with Magento 2.1.5.
    Hosting is unfortunately not available through ssh.
    However, phpinfo () informs that the module is installed.
    How to fix it?
    Thank you

Leave a comment

 

Welcome to my Blog

Kalpesh MehtaHelping Magento developers in their day-to-day development problems since 2011. Most of the problems and solutions here are my own experiences while working on different projects. Enjoy the blog and don't forget to throw comments and likes/+1's/tweets on posts you like. Thanks for visiting!

Certifications