Long story short: just installed Ubuntu 12.04 (Debian based), nginx, php-fpm and mysql. Now I need the MySQL driver for PHP, but which should I choose?

Which is better php-mysqlnd or php-mysql?

1 Answer 1


php-mysqlnd is the better choice. It is a drop-in replacement for the php-mysql extension. Here you can find more information about it.

Excerpt from the above-mentioned link:

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:

  • Powerful plugin API to extend feature set
  • Asynchronous, non-blocking queries
  • 150+ performance statistics
  • Powerful plugins

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.