Hi everyone, i try to connect my Databases (MySQL client version: 4.1.22) on my windows Azure (PHP5.4) but fail,
Below is the error code
CDbException
CDbConnection failed to open the DB connection: SQLSTATE[HY000] [2000] 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 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
Base on what i check in google the solution is
-
SET SESSION old_passwords = 0;
-
In PHP Code change my mysql_connect function to include the client flag 1:
define(‘CLIENT_LONG_PASSWORD’, 1);
mysql_connect(’[your server]’, ‘[your username]’, ‘[your password]’, false, CLIENT_LONG_PASSWORD);
So how could i config this in my protected/config/main.php ?
Below is the reference link that i found