开发者

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

开发者 https://www.devze.com 2023-03-28 06:09 出处:网络
I\'m having issues with connecting to MySQL 5.5.8 from PHP 5.3.5 (WAMP install). I\'m getting the error below:

I'm having issues with connecting to MySQL 5.5.8 from PHP 5.3.5 (WAMP install). I'm getting the error below:

mysqlnd cannot connect to MySQL 4.1+ using the old insecure authentication. 
Please use an administration tool to reset your password with the command 
SET PASSWORD = PASSWORD('your_existing_password'). This will store a new, and 
more secure, hash开发者_如何学Go value in mysql.user. If this user is used in other scripts 
executed by PHP 5.2 or earlier you might need to remove the old-passwords flag 
from your my.cnf file

I've tried every suggestion I could find on the web, including several from Stack Overflow and this one: http://engin.bzzzt.biz/2010/11/12/php-mysql-insecure-authentication/

I've checked my settings and the old-passwords flag is off. I've updated my password to the new password hash and verified that the hash is 41 chars in the users table and flushed privileges. For some reason, I'm still getting the error. Anyone have any ideas?

Update: I'm using ZenCart. This is the line where my connection is being made and where the error is being thrown:

$this->link = @mysql_connect($zf_host, $zf_user, $zf_password, true) or die (mysql_error());


Connect to MySQL with a client using the user that has the problem, execute following command:

SET old_passwords=0;
SET password=PASSWORD('your current password');


Figured it out! Was an oversight on my part. Apparently, in ZenCart there are 2 files where you have to set your database configuration. One is for the catalog and one for the admin area. Doesn't make a whole lot of sense to me since both of them connect to the same DB. Maybe it has something to do with being able to use one db user for the catalog and one for the admin for security reasons. I just setup a local copy and changed one of the config files without changing the other. The file causing the problems was still pointed at my production database. Knew it had to be something simple!

0

精彩评论

暂无评论...
验证码 换一张
取 消