I was trying to connect to MySQL
database on a remote server from the command line.
mysql --host=<host name> --user=<username> --password=<password> <db name>
I have no issue with connecting to the db from the PHP source but I encountered this error while trying to connect from command line. I connected with exactly same username and password.
ERROR 1045 (28000): Access denied for user '<username>'@'<host IP address>' (using password: YES)
I am not sure which went wrong.