MySQL Proxy簡介,mysqlproxy簡介

來源:互聯網
上載者:User

MySQL Proxy簡介,mysqlproxy簡介

作者:zhanhailiang 日期:2015-01-01

MySQL Native Driver簡稱mysqlnd,作為libmysqlclient替代品於PHP5.3.0版本引入。之前,MySQL資料庫擴充mysql,mysqli,PDO MYSQL都是通過libmysqlclient實現與MySQL Server的通訊。引入mysqlnd,這三個擴充都可以通過mysqlnd實現與MySQL Server的通訊。

其較libmysqlclient的通訊原理對比如:

優點
  1. mysqlnd更容易編譯;因為它是php源碼樹的一個組成部分;而基於libmysqlclient編譯,意味著需要在本地安裝MySQL;
  2. mysqlnd和php內部機制結合更緊密,是最佳化過的mysql驅動;
  3. mysqlnd更節省記憶體,從測試結果來看,比傳統的mysql擴充節省40%的記憶體;
  4. mysqlnd更快;
  5. mysqlnd提供了豐富的效能統計功能;
  6. mysqlnd通過MySQL Native Driver Plugin API特性來充當MySQL Proxy,實現負載平衡,監控和效能最佳化
  7. mysqlnd使用了PHP license以避免不必要的著作權糾紛;
安裝
./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
測試
[root@/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 $
更多閱讀
  1. mysqlnd
  2. mysqlnd plugins

相關文章

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.