While installing OpenCart if you get following error at the Step 3 (configuration of datbase and admin)

"Could not connect to the database please make sure the database server, username and password is correct!"
and you feel that all the details of datbases are correct, then please check if the password for database user contains special characters.

The OpenCart accepts only Alphabets and Numbers in the password. So please change the password for database user associated with OpenCart database.

It worked for me.