A lot of you have recently upgraded to PHP5.3, and one of the new things is the MySQL connection. If you are using the old authentication you will have to update your password encryption. Otherwise it will throw a warning and not able to connect.
This is the message you get when you try and connect
Warning: mysqli::mysqli() [mysqli.mysqli]: (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 in /var/www/public_html/db/connect.php on line 10 |
As always there is an easy fix for this
SET old_passwords = 0; UPDATE mysql.user SET Password = PASSWORD('your_existing_password') WHERE User = 'your_username' limit 1; FLUSH PRIVILEGES; |
To verify that your password has the new encryption, test the length of the password column, should match 41 characters.
SELECT LENGTH(Password) FROM mysql.user WHERE User = 'your_username'; |
Interactive PHP
Learn interactive PHP click here to find out more
Linux training
If you need to improve your skills try my linux training guide, read more
