Error needs to resolve

Warning: mysql_connect() [function.mysql-connect]: Access denied for user ‘triviaso_alton’@‘localhost’ (using password: YES) in /home/triviaso/public_html/allark/config.php on line 8
Could not connect to MySqlAccess denied for user ‘triviaso_alton’@‘localhost’ (using password: YES)

When I upload my site from local machine to hosted server

The username, password or hostname are not correct.

On your local machine, localhost points to your local machine.

On your server, localhost points to your server.

The MySQL server on your host is responding that there is no authorized user “triviaso_alton” with the password you supplied.

Changed my online config.php file to the server host but still gives the same error

Warning: mysql_connect() [function.mysql-connect]: Access denied for user ‘triviaso_allark’@‘chief.urlnameserver.com’ (using password: YES) in /home/triviaso/public_html/allark/config.php on line 6
Could not connect to MySqlAccess denied for user ‘triviaso_allark’@‘chief.urlnameserver.com’ (using password: YES)

Warning: mysql_connect() [function.mysql-connect]: Access denied for user ‘triviaso_alton’@‘localhost’ (using password: NO) in /home/triviaso/public_html/allark/login-exec.php on line 15
Failed to connect to server:

Now I face this error

Your hostname, username or password are still wrong. Nobody here can tell you what the right values are. Double check that whatever you set up in your hosting control panel (or directly through mysql) matches what you put in your code. Double check that the mysql server you’re connecting to is actually reached at the host you put in your code (some web hosts run separate physical mysql servers from their web server, so it wouldn’t be localhost).