PDO drivers does not have mysql or PDO drivers does not support mysql. The reason is the same, the lack of the pDO_mysql extension.

Solutions:

The solution is simple: do you have the PDO extension installed? If you already have the PDO extension installed. Have you installed a type extension that supports PDO connection to the database? PDO supports many database types. For example, mysql, SQLite, and PGSQL.

Tell me how I solved the problem “could not find driver”.

1. Check whether the PDO extension is installed.

View it directly with the phpInfo () function.

The PDO extension currently supports only SQLite databases, but my friend is using mysql databases, so it is normal to report errors.

2, enable pDO support mysql database type driver extension: pDO_mysql.

If you are on a Windows server, modify php.ini directly and remove the “;” from the beginning. This extension can be turned on.

If you are a Linux server, you will need to install the pdo_mysql extension yourself.

Install pdo_mysql from source package as follows:

CD/usr/local/php5.5.28 / etx/pdo_mysql/usr/local/PHP/bin/phpize. / configure –with-php-config=/fujieace/ PHP /bin/php-config make && make install pdo_mysql.so

Nstalling Shared extensions: / usr/local/PHP/lib/PHP/extensions/no – debug – non – ZTS – 20121212 / * * * put pdo_mysql. So join PHP. Ini:

extension=/usr/local/php/lib/php/extensions/no-debug-non-zts-20121212/pdo_mysql.so

3. Check whether the operation is successful.

After restarting PHP, if you install pdo_mysql successfully.

Note: the pdo_mysql extension installed on Linux must be consistent with your PHP version. (It is recommended to install the mysql extension from the source code.)