I came across similar kind of issue.
In my case the problem was in my command where I was providing the port after '-p' which is assigned for password. For, port '-P' should be in capital letter, not in small.
So, I replaced this command "mysql -h your-endpoint.rds.amazonaws.com -p your-port -u your-username -p" with "mysql -h your-endpoint.rds.amazonaws.com -P your-port -u your-username -p" and it worked fine. case sensitivity was the main issue.