500 error for all pages and post after move localhost to server

First change database name, username and password in the config.php file

/** The name of the database for WordPress */
define('DB_NAME', 'DB_NAME');

/** MySQL database username */
define('DB_USER', 'DB_USERNAME');

/** MySQL database password */
define('DB_PASSWORD', 'DB_PASSWORD');

then upload the database and run the following queries, this will change all the local links to your live url

UPDATE wp_options SET option_value = replace(option_value, 'http://www.oldurl', 'http://www.newurl');

UPDATE wp_posts SET guid = replace(guid, 'http://www.oldurl','http://www.newurl');

UPDATE wp_posts SET post_content = replace(post_content, 'http://www.oldurl', 'http://www.newurl');

UPDATE wp_postmeta SET meta_value = replace(meta_value,'http://www.oldurl','http://www.newurl');

After this wp-admin should work, then login and go to settings>permalink and hit save which will reset the redirects.

enter image description here