php 5.3开始使用mysqlnd作为的默认mysql访问驱动
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访问驱动的更多相关文章
- 连接mysql问题 mysqlnd cannot connect to MySQL 4.1+ using old authentication
第一篇:PHP5.3开始使用MySqlND作为默认的MySql访问驱动,而且从这个版本开始将不再支持使用旧的用户接口链接Mysql了,你可能会看到类似的提示: #2000 - mysqlnd cann ...
- mysqlnd cannot connect to MySQL 4.1+
phpMyAdmin - error #2000 - mysqlnd cannot connect to MySQL 4.1+ using the old insecure authenticatio ...
- 【转】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 ...
- mysqlnd cannot connect to MySQL 4.1+ using the old insecure authentication解决办法
mysqlnd是个好东西.不仅可以提高与mysql数据库通信的效率,而且也可以方便的设置一些超时.如,连接超时,查询超时.但是,使用mysqlnd的时候,有个地方需要注意.就是服务端的密码格式不能使用 ...
- 解决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: ...
- 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 ...
- mysqlnd cannot connect to MySQL 4.1+ using old authentication
报这个错误主要是因为mysql使用了老的密码格式,而程序要求使用新的格式导致的,解决办法: SET old_passwords = 0; UPDATE mysql.user SET Password ...
- window下安装wamp环境
Wamp就是Windos Apache Mysql PHP集成安装环境,即在window下的apache.php和mysql的服务器软件.其中php环境配置是至关重要的一部分,本文就针对php在本地的 ...
- MySQL系列教程(四)
文件打开数(open_files) 我们现在处理MySQL故障时,发现当Open_files大于open_files_limit值时,MySQL数据库就会发生卡住的现象,导致Nginx服务器打不开相应 ...
随机推荐
- run fsck manually
就出现unexpected inconsistency run fsck manually这个问题了. 磁盘出问题,需要用 Fsck修复... 解决方案: 在命令行输入#mount | grep ”o ...
- JavaPersistenceWithHibernate第二版笔记-第四章-Mapping persistent classes-001区分entities and value types
一.介绍 1.这种引用方式不对,但删除时不能级联 要这种引用方式 2.The Bid class could be a problem. In object-oriented modeling, th ...
- 关于java中split的使用
之前在http://shukuiyan.iteye.com/blog/507915文中已经叙述过这个问题,但是最近一次笔试中居然有碰到了这个知识点,而且还做错了,囧!学艺不精啊.题目大概是这样的: ) ...
- Hibernate笔记——第一个简单实例
1. 首先进行框架配置 导包 hibernate配置xml文件 ======================= 2. 创建并配置POJO类 Hibernate是操作持久化层的框架,和数据库打交道,其 ...
- photoshop:css3插件
CSS3PS是Photoshop 插件,用来将 PhotoShop 的图层如内阴影.内发光.阴影.外发光.图片圆角等效果转成用 CSS3 样式. 官方下载地址>> http://css3p ...
- linux shell 命令学习(3) split - split a file into pieces
split 用来进行文件分割的指令 split [OPTION]... [INPUT [PREFIX]] 发现这个命令是因为有个需求,有个10W行的文本文件,需要分成5个2w行的文本文件, 查了一下资 ...
- JAVA编译异常处理:java.lang.OutOfMemoryError: PermGen space
在Intellij开发工具中编译JAVA项目,出现以下错误: 六月 21, 2016 6:28:07 下午 org.apache.tomcat.util.modeler.BaseModelMBean ...
- Sails 关闭自动路由 Automatic Routes 功能。
Sails 关闭自动路由 Automatic Routes 功能. Sails 中的路由两种:Custom Routes 和 Automatic Routes,自定义路由和自动路由.详见文档: Sai ...
- C# List.sort排序详解(多权重,升序降序)
很多人可能喜欢Linq的orderBy排序,可惜U3D里面linq在Ios上会报错,所以就必须使用list的排序. 其实理解了并不难 升序降序比较 sort有三种结果 1,-1,0分别是大,小,相等. ...
- 《OD大数据实战》Hive环境搭建
一.搭建hadoop环境 <OD大数据实战>hadoop伪分布式环境搭建 二.Hive环境搭建 1. 准备安装文件 下载地址: http://archive.cloudera.com/cd ...