---
title: "mysqlnd cannot connect to MySQL 4.1+ using the old insecure authentication"
author: "yuanyu5237"
date: "2012-06-14T09:45:37Z"
tags: []
categories: ["数据库"]
slug: "mysqlnd-cannot-connect-to-mysql-4-1-using-the-old-insecure-authentication"
draft: false
lastmod: "2012-06-14T09:45:37Z"
id: 1560591
url: "https://yuandingping.iteye.com/blog/1560591"
---

我在使用easyPHP的时候，连mysql连不上，报错

 写道

mysqlnd cannot connect to MySQL 4.1+ using the old insecure authentication

 

原因应该是密码长度或者格式不对，解决办法：

 

```
SET old_passwords = 0;
UPDATE mysql.user SET Password = PASSWORD('testpass') WHERE User = 'testuser' limit 1;
SELECT LENGTH(Password) FROM mysql.user WHERE User = 'testuser';
FLUSH PRIVILEGES;
```