Hi, Welcome to the tutorial. Lets checkout how to edit wp-config file in WordPress to change or update your database details
1- cPanel Access, this is your webhosting dashboard where your website files are hosted.
2- Make a backup of your file
3- Basic knowlege of php or any other programming language to help you understand what needs changing and how ? If you are not an expert dont worry, below is a video tutorial to help guide non technical audiences.
Common use cases for editing this file
1- updating your database and user details
2- wordpress error establishing database connection
Below, I have shared a screenshot sample of wp-config.php file, that will help you understand what is inside this file or what the contents of this file looks like ?
Lets, get to the business and start editting our file. At this point, I assume you have your file opened in the editor. Please follow instructions below –
Note: MySQL settings – You can get this info from your cPanel or web developer
1- Code below allows you to change your wordpress websites database to your new database name
just update the last part, to with the new name-
and thats it.
2- Similarly change MySQL database username
3- Update to the latest MySQL database password
4- MySQL hostname (this line and rest of the file stays unchanged)
Hope this helped, please leave your thoughts in comments below.