When you install a fresh wordpress website, the CMS by default create TWO config-php files which are:
Once, installation is done, then it is always recommended to remove "wp-config-sample.php" from the server, so that hackers can't use it to hack your website.
Now coming, to your question, where did you added the DB Name, ID and Password?
But, if your website was already live and shifted your wordpress website from one server to another then you may notice an 404 error all across the pages. This may be because of SSL issue and .htaccess.
You may have to install and activate ssl on your website using cpanel read this.
My website issue fixed using ssl installation.