Basicaly it is telling you the password or username is incorrect.
Have you added a user to the online database?
Quite often if you have a username of say "bolgs" and a hosting account with a username of "fred" the username for the database would be "fred_blogs".
but in localhost it works perfectely
Do you have a seperate connection file for use localy and online as I doubt both usernames and passwords are the same?