How do I install the pdo_mysql driver on Red Hat Enterprise Linux 6.1?

Solution 1:

You probably want to install the php-mysql package:

Name       : php-mysql
Arch       : x86_64
Version    : 5.3.6
Release    : 1.w5
Size       : 210 k
Repo       : installed
Summary    : A module for PHP applications that use MySQL databases.
URL        : http://www.php.net/
License    : PHP
Description: The php-mysql package contains a dynamic shared object that will add MySQL database support to PHP. MySQL is an
           : object-relational database management system. PHP is an HTML-embeddable scripting language. If you need MySQL
           : support for PHP applications, you will need to install this package and the php package.

Solution 2:

To update this answer for lost souls in 2020, with a RHEL 8 fresh install loaded with PHP 7.2, in order for the PDO driver for mysql to show up in the phpinfo() page, two packages must be installed: yum -y install php-pdo php-mysqlnd

Solution 3:

Thank you very much to Karl. I was having problem to install pdo-mysql, and tried all many things, but then your suggestion to install following fixed it for me

yum install php-ZendFramework-Db-Adapter-Pdo-Mysql.noarch

My system is a Centos6.7 and I have php5.6. another version of php was showing that pdo-mysql is installed. But phpinfo() was not showing it. When i tried yum install pdo-mysql. it was saying package is not available. Anyway, above zend package fixed it for me.

Thanks a lot.