mysqlnd成爲php 5.3中的默認mysql驅動,它有以下優勢:php
這個改動應同時對mysql和pdo_mysql擴展生效。mysql
(ps)若是在使用php5.3.X的時候遇到這個提示:「mysqlnd cannot connect to MySQL 4.1+ using old authentication」,那麼就是由於php5.3.x使用password作密碼加密,而不是old_password。old_password加密後爲16位的字符串,password加密的爲41位的字符串。這時只須要用password從新修改下密碼並使之生效就能夠了。sql
mysqlnd是mysql原裝的php驅動
考文章:http://forge.mysql.com/wiki/PHP_MYSQLND#A_brief_history_of_PHP.E2.80.99s_MySQL_APIs網絡
介紹了關於mysql在PHP中的成長過程~ide
/ext/mysql /ext/mysqli /pdo/mysql都是用C寫出來的擴展,也叫PHP的API,這三者都是用了libmysql(MySQL Client Library)。函數
Mysqlnd is neither a new PHP extension nor a new API! mysqlnd is new C-level library code. The mysqlnd library provides almost the same functionality as libmysql does. Both C-libraries implement the MySQL communication protocol and can be used to connect to the MySQL Server.性能
However, libmysql is a generic C-library with Dual-Licensing. Any C-based program can use it. As PHP is based on C, PHP is using it. mysqlnd is not a generic C-library. mysqlnd is licensed under the PHP license and it is tightly integrated into PHP on the C-level. For example, mysqlnd is using the PHP memory management functions and network streams. Due to the close integration, it is difficult for other C programs but PHP to use the library. Any other C program that tries to use mysqlnd would need to link against large parts of PHP. Maybe this explains what 「native」 and 「for PHP」 means.測試
總的意思是說mysqlnd是一種新的函數庫,libmysql有的功能它幾乎都有,可是mysqlnd並不像libmysql那樣做爲通用庫,它是專門爲PHP而寫的一個庫,用了PHP的內在管理函數以及一些網絡流的函數優化