Do you have a program like navicat or SQLYog you can use to test the connection? The database will usually have a separate ip address from the web site.
When you contact your hosting provider, don't mention the error you get from our file. That gives them the cop out they are using.
Instead just ask for the proper credentials to connect to the database remotely using a program like Navicat or SQLYog. The same credentials should work in your connection file.
I'd even download an evaluation copy of one of them to test the information outside of your local web server to verify it is correct.