Renaming a database in phpMyAdmin is done with a few straightforward steps. As always, it pays to have a recent backup before undertaking operations that impact important data.
Before actually renaming the database, it's a smart plan to check what user has access to the database and what permissions they've been granted. After renaming the database, you'll need to assign the user and privileges to the renamed (new) database.
Notes:
If you are using cPanel, it is recommended to add the user and set privileges from within cPanel so that backups and restores work properly.
If using cPanel, the database can be renamed within cPanel, Current Databases → Rename, and grants will be assigned to the newly named database all within the one command.