Check with your hosting co as they are most likely running the db servers on a different server (and certainly not locahost). They will also have to give you a database name, user and password which you must put into your PHP.
It's a pain but I get around it by adding code the check the host name and use the appropriate database, user and password.
Check out to see if they have a FAQ with examples of how to use mySQL in their servers.
Cheers,
Cris