Could not connect: Connection using old (pre-4.1.1) authentication protocol

来源:互联网 发布:sqlserver数据库迁移 编辑:程序博客网 时间:2024/05/18 03:46

同事总结,主要是发现问题,解决问题。发现问题很重要。

Could not connect: Connection using old (pre-4.1.1) authentication protocol   报错
其实只要进数据库
set old_passwords=0;
show variables like '%password%';
SET PASSWORD FOR 'root'@'localhost' = PASSWORD('uplooking');
这样就可以了


关键在于发现问题:php连数据库
<?php
$link = mysql_connect('localhost', 'root', 'uplooking') ;
if (!$link) {
    die('Could not connect: ' . mysql_error());
}
echo 'Connected successfully';
mysql_close($link);
?>

参考链接:

 http://see.sl088.com/wiki/MySQL_4.1%E4%B9%8B%E5%90%8E%E7%9A%84%E5%93%88%E5%B8%8C%E5%8A%A0%E5%AF%86%E9%97%AE%E9%A2%98

0 0
原创粉丝点击