Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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?

share|improve this question

1 Answer 1

up vote 9 down vote accepted

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
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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