php 5.3开始使用mysqlnd作为的默认mysql访问驱动
2014-05-23 11:19
603 查看
mysqlnd成为php 5.3中的默认mysql驱动,它有如下优点:
mysqlnd更容易编译: 因为它是php源码树的一个组成部分
mysqlnd和php内部机制结合更紧密,是优化过的mysql驱动
mysqlnd更节省内存,从测试结果来看,比传统的mysql扩展节省40%的内存
mysqlnd更快
mysqlnd提供了丰富的性能统计功能
mysqlnd使用了PHP license以避免不必要的版权纠纷
这个改动应同时对mysql和pdo_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重新修改下密码并使之生效就可以了。
考文章:http://forge.mysql.com/wiki/PHP_MYSQLND#A_brief_history_of_PHP.E2.80.99s_MySQL_APIs
介绍了关于mysql在PHP中的成长过程~
PHP 3+ - ext/mysql: the oldest extension and API - please don’t use it any more, it does not support all MySQL features.
PHP 5+ - ext/mysqli: the “current” extension and API - supports all features of MySQL
PHP 5+ - PDO/MySQL: an extension and database API abstraction layer introduced with PHP 5
/ext/mysql /ext/mysqli /pdo/mysql都是用C写出来的扩展,也叫PHP的API,这三者都是用了libmysql(MySQL Client Library)。
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的内在管理函数以及一些网络流的函数
mysqlnd更容易编译: 因为它是php源码树的一个组成部分
mysqlnd和php内部机制结合更紧密,是优化过的mysql驱动
mysqlnd更节省内存,从测试结果来看,比传统的mysql扩展节省40%的内存
mysqlnd更快
mysqlnd提供了丰富的性能统计功能
mysqlnd使用了PHP license以避免不必要的版权纠纷
这个改动应同时对mysql和pdo_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重新修改下密码并使之生效就可以了。
mysqlnd是什么
mysqlnd是mysql原装的php驱动考文章:http://forge.mysql.com/wiki/PHP_MYSQLND#A_brief_history_of_PHP.E2.80.99s_MySQL_APIs
介绍了关于mysql在PHP中的成长过程~
PHP 3+ - ext/mysql: the oldest extension and API - please don’t use it any more, it does not support all MySQL features.
PHP 5+ - ext/mysqli: the “current” extension and API - supports all features of MySQL
PHP 5+ - PDO/MySQL: an extension and database API abstraction layer introduced with PHP 5
/ext/mysql /ext/mysqli /pdo/mysql都是用C写出来的扩展,也叫PHP的API,这三者都是用了libmysql(MySQL Client Library)。
mysqlnd is not a new extension! mysqlnd is it not a new API!
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的内在管理函数以及一些网络流的函数
相关文章推荐
- mysqlnd成为php 5.3中的默认mysql驱动
- PHP 5.3以上版本推荐使用mysqlnd驱动
- PHP 5.3以上版本推荐使用mysqlnd驱动
- PHP 5.3以上版本推荐使用mysqlnd驱动
- PHP 5.3以上版本推荐使用mysqlnd驱动
- php 数据库 _使用php访问mysql
- 偶决定开始使用 Chrome 作为默认浏览器了
- 使用PHP访问MySQL(1)
- PHP 5.3.0以上推荐使用mysqlnd驱动
- PHP 5.3.0以上推荐使用mysqlnd驱动
- MySQL使用可重复读作为默认隔离级别的原因
- [转]PHP 5.3.0以上推荐使用mysqlnd驱动
- [DB] InnoDB 作为默认存储引擎(从mysql-5.5.5开始)
- PHP 5.3.0以上推荐使用mysqlnd驱动
- mysql 5.x使用utf8作为默认字符集
- PHP 5.3.0及以上版本已经内置mysqlnd驱动, 所以安装php时并不需要预先安装mysql, 你可以在安装php之后再安装mysql(这与之前版本的php安装顺序差异较大). mysql
- 偶决定开始使用 Chrome 作为默认浏览器了
- LINUX下PHP使用PDO访问MYSQL的连接设置注意事项
- php5.3新特性 之 mysql native driver(mysqlnd) .
- 使用PHP实现请求响应和MySql访问