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重新修改下密码并使之生效就可以了。

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的内在管理函数以及一些网络流的函数

php 5.3开始使用mysqlnd作为的默认mysql访问驱动的更多相关文章

  1. 连接mysql问题 mysqlnd cannot connect to MySQL 4.1+ using old authentication

    第一篇:PHP5.3开始使用MySqlND作为默认的MySql访问驱动,而且从这个版本开始将不再支持使用旧的用户接口链接Mysql了,你可能会看到类似的提示: #2000 - mysqlnd cann ...

  2. mysqlnd cannot connect to MySQL 4.1+

    phpMyAdmin - error #2000 - mysqlnd cannot connect to MySQL 4.1+ using the old insecure authenticatio ...

  3. 【转】Warning: mysql_connect(): mysqlnd cannot connect to MySQL 4.1+ using the old insecure authenticat

    Warning: mysql_connect(): mysqlnd cannot connect to MySQL 4.1+ using the old insecure authenticat 当m ...

  4. mysqlnd cannot connect to MySQL 4.1+ using the old insecure authentication解决办法

    mysqlnd是个好东西.不仅可以提高与mysql数据库通信的效率,而且也可以方便的设置一些超时.如,连接超时,查询超时.但是,使用mysqlnd的时候,有个地方需要注意.就是服务端的密码格式不能使用 ...

  5. 解决Mysql报错:PHP Warning: mysql_connect(): mysqlnd cannot connect to MySQL 4.1+ using the old insecure authentication.

    最近我更新了appserv-win32-2.5.10的 PHP 5.2版本到PHP 5.3,在调用http://localhost/phpMyAdmin/时,出现如下错误:PHP Warning:   ...

  6. mysqlnd cannot connect to MySQL 4.1+ using the old insecure authentication的解决方法

    直接命令行操作没有问题,但是PHP连接就会报上面的错误. SET old_passwords =0; USE mysql; UPDATE user SET password =PASSWORD('yo ...

  7. mysqlnd cannot connect to MySQL 4.1+ using old authentication

    报这个错误主要是因为mysql使用了老的密码格式,而程序要求使用新的格式导致的,解决办法: SET old_passwords = 0; UPDATE mysql.user SET Password ...

  8. window下安装wamp环境

    Wamp就是Windos Apache Mysql PHP集成安装环境,即在window下的apache.php和mysql的服务器软件.其中php环境配置是至关重要的一部分,本文就针对php在本地的 ...

  9. MySQL系列教程(四)

    文件打开数(open_files) 我们现在处理MySQL故障时,发现当Open_files大于open_files_limit值时,MySQL数据库就会发生卡住的现象,导致Nginx服务器打不开相应 ...

随机推荐

  1. lintcode:数字组合 II

    数字组合 II 给出一组候选数字(C)和目标数字(T),找出C中所有的组合,使组合中数字的和为T.C中每个数字在每个组合中只能使用一次. 注意事项 所有的数字(包括目标数字)均为正整数. 元素组合(a ...

  2. 解决IIS应用程序池DefaultAppPool关闭超时错误

    错误系统日志: 为应用程序池“DefaultAppPool”提供服务的进程关闭时间超过了限制.进程 ID 是“3060”. 有关更多信息,请参阅在http://go.microsoft.com/fwl ...

  3. ios 监听app从后台恢复到前台

    正常情况下,在AppDelegate中实现下面两个方法,能够监听从后台恢复到前台 [cpp] - (void)applicationDidEnterBackground:(UIApplication ...

  4. ADB调试桥安装(方式一)

    一.ADB简介 adb的全称为Android Debug Bridge,起到调试桥的作用.它android sdk里的一个工具, 用这个工具可以直接操作管理 android模拟器或者真实的androi ...

  5. Java中的Enum的使用与分析

    使用name()方法和valueOf(String)方法可以在枚举类型对象和字符串之间方便得转换.如果valueOf(String)方法的参数不是该枚举类型合法的字符串,则会抛出IllegalArgu ...

  6. SPOJ 78 Marbles 组合数学

    相当于从n-1个位置里面找k-1个位置放隔板 #include <cstdio> #include <cstring> #include <cstdlib> #in ...

  7. C# 获取打印机状态

    public static string GetPrinterStatus(string PrinterName)    {    int intValue = GetPrinterStatusInt ...

  8. Android OTA 升级之三:生成recovery.img

    Android OTA 升级之三:生成recovery.img 作者: 宋立新 Email:zjujoe@yahoo.com 前言 得到了ota升级包后,我们就可以用它来升级系统了.Android 手 ...

  9. C#中的转换

    11.3  转换 到目前为止,在需要把一种类型转换为另一种类型时,使用的都是类型转换.而这并不是唯一的方式. 在计算过程中,int可以采用相同的方式隐式转换为long或double,还可以定义所创建的 ...

  10. arranging-coins

    https://leetcode.com/problems/arranging-coins/ public class Solution { public int arrangeCoins(int n ...