MySQL native driver for PHP - mysqlnd The MySQL native driver for PHP is a drop-in replacement for the MySQL Client Library for the PHP script language. PHP MySQL extensions The PHP MySQL extensions are lightweight wrappers on top of a C client library. There are 3 PHP MySQL extensions:. (not recommended). It is recommended to use either the mysqli or PDOMySQL extensions. It is not recommended to use the old mysql extension for new development. Choosing a Library The extensions can either use the mysqlnd or libmysql library to connect from PHP to MySQL.
Choosing one or the other library is a compile time decision. Both libraries are supported and constantly being improved. MySQL recommends using the MySQL native driver for PHP (mysqlnd) together with ext/mysqli or PDOMySQL.
Download Source Code & Binaries All 3 PHP MySQL extensions and the mysqlnd library are part of the source code of PHP. The source code and binaries are available from: PHP 5.4 has mysqlnd as default As of PHP 5.4, the mysqlnd library is a php.net compile time default to all PHP MySQL extensions. Also, the php.net Windows team is using mysqlnd for the official PHP Windows distribution since mysqlnd became available in PHP 5.3. Advantages of using mysqlnd The mysqlnd library is highly optimized for and tightly integrated into PHP. The MySQL Client Library cannot offer the same optimizations because it is a general-purpose client library. The mysqlnd library is using PHP internal C infrastructure for seamless integration into PHP.
In addition, it is using PHP memory management, PHP Streams (I/O abstraction) and PHP string handling routines. The use of PHP memory management by mysqlnd allows, for example, memory savings by using read-only variables (copy on write) and makes mysqlnd apply to PHP memory limits. Additional advantages include:. Ships together with the PHP 5.3, and later, source. No need to install MySQL Client Library. Powerful plugins. Mysqlnd Plugins A wide range of mysqlnd plugins, providing additional features are available from.
Popular mysqlnd plugins include:. Additional Resources.