The first error you are getting is telling you that the details in your connection file on your server are not correct. The values that you have specified in here do not have access to the db. You will need to update the details in the connection file on your live server with the correct username and password in order to access the db. You may also need to adjust the host value that points to the db. You should have the values you need for this in the settings on your hosting account, if you can't get to them you may need to contact your host to help you retrieve them.
The second error you are getting when you test locally is telling you that the connection folder is not in your web root. What folder are you storing the files in locally on your web server? You will need to adjust the testing server URL value to match the location of the files on your local server.