zhanhailiang 日期:2015-01-01
MySQL Native driver abbreviated as MYSQLND, introduced as Libmysqlclient substitute in PHP5.3.0 version. Previously, MySQL database extension mysql,mysqli,pdo MySQL was implemented through libmysqlclient to communicate with MySQL server. With the introduction of MYSQLND, all three extensions can communicate with MySQL server through MYSQLND.
Advantages
- Mysqlnd is easier to compile because it is an integral part of the PHP source tree, and compiling based on libmysqlclient means that MySQL is required to be installed locally;
- Mysqlnd and PHP internal mechanisms are more tightly coupled and are optimized for MySQL drivers;
- Mysqlnd saves more memory and, from the test results, saves 40% of memory than the traditional MySQL extension;
- Mysqlnd faster;
- MYSQLND provides a wealth of performance statistics functions;
- MYSQLND uses MySQL Native Driver Plugin API feature to act as MySQL Proxy for load balancing, monitoring and performance optimization
- MYSQLND uses PHP license to avoid unnecessary copyright disputes;
Installation
./configure --prefix=/usr/local/php-5.3.29-production --with-mysql=mysqlnd --with-mysqli=mysqlnd --with-openssl --with-pdo-mysql=mysqlnd --enable-fpm --enable-mysqlndmake && make install
Test
[[Email protected]/usr/local]#/usr/local/php-5.3.29-production/bin/php-ini|grep mysqlndconfigure Command =]. Configure '--prefix=/usr/local/php-5.3.29-production '--with-pear '--with-iconv=/usr/local/'--with-mysql= Mysqlnd '--with-mysqli=mysqlnd '--with-openssl '--with-libxml-dir '--with-curl '--with-pdo-mysql=mysqlnd '-- Disable-fileinfo '--enable-fpm '--enable-mysqlnd '--with-mcrypt '--enable-mbstring ' Client API Version = Mysqlnd 5.0.8-dev-20102224-$Id: 731e5b87ba42146a687c29995d2dfd8b4e40b325 $Client API Library Version = Mysqlnd 5.0 .8-dev-20102224-$Id: 731e5b87ba42146a687c29995d2dfd8b4e40b325 $mysqlndmysqlnd = enabledversion = Mysqlnd 5.0. 8-dev-20102224-$Id: 731e5b87ba42146a687c29995d2dfd8b4e40b325 $Client API Version = Mysqlnd 5.0.8-dev-20102224- $Id: 731e5b87ba42146a687c29995d2dfd8b4e40b325 $
Read more
- Mysqlnd
- Mysqlnd Plugins
Introduction to MYSQLND Extensions