First of all before changing database name make a full back up of your site (files and database both) so if by mistake something went wrong you can recover site back.
In order to change database name from db_test to db_final following steps should be followed-:
Update phpMyAdmin Database
1) Go to phpMyAdmin.
2) Select Database Name(db_test) from the database list on the left-hand side of phpMyadmin. Then click on the OPERATIONS tab.
3) Write the name you want to change your database name to in the RENAME DATABASE TO: section. As here we need to change database name to db_final and click on the GO button. A pop-up
window will come; click OK to accept the changes.
- Path is as follows-: /wp-content/themes/themename
- In case of cPanel -: select the file from the list and click on the Edit button. If a pop-up appears, click Edit again.
- In case of FTP -: download wp-config.php file through and edit it with a text editor.
You can choose any of the above method; rename your new database name by finding the code similar to the one below:
// ** MySQL settings - You can get this info from your web host ** //
/** The name of the database for WordPress */
/** MySQL database username */
/** MySQL database password */
/** MySQL hostname */
/** Database Charset to use in creating database tables. */
Find “db_test” which is the original name of your database and rename it with the new name (db_final) you gave to database above in 3rd step.
Save the file or upload it if you’re using FTP.
5) Assign a User to Database
In cPanel, click on MySQL Database and add a user to a database by choosing username from the drop down box.
Now, select your new database name “db_final” from the Database drop down box and click on ADD button. After that, select the ALL PRIVILEGES checkbox and then click the MAKE CHANGES button.
6) At last reactivate all your plug-in and the changes are done.