The server requested authentication method unknown to the client
So I run a search and found this
MySQL introduced longer password hashes in (i think) version 4.1, and your server probably still uses them (check for 16 byte password hashes in your mysql user table). Newer versions use longer password hashes. Your server supports both, but your client (php) seems to support only new ones in this version (and on).
First check if "old_passwords=1" is in your my.cnf. Remove that first then restart MySQL.
Then login to your MySQL server and run the command below.
SET PASSWORD FOR 'username'@'hostmask' = PASSWORD('thepassword')