To rename a database table, open phpMyAdmin, select the table, and use the Rename table to field under Operations. The table keeps all of its columns and data; only its name changes.
Before you start
You need a user with full rights on the database. A user with limited rights may not see the Operations tab, or may get a permission error.
Open phpMyAdmin from your control panel. Database and user names are shown in the MySQL Databases tool in cPanel, and in the client area at https://my.hostking.host.
Rename a table
cPanel
- Log in to cPanel.
- In the Databases section, click phpMyAdmin. It opens in a new tab.
- In the left sidebar, click the database that contains the table.
- Click the table you want to rename.
- Click the Operations tab.
- In the Table options box, find Rename table to and type the new name.
- Click Go at the bottom of the Table options box.
- Check the left-hand panel. The table now appears under its new name.
DirectAdmin
The steps for opening phpMyAdmin in DirectAdmin are not covered here. Once phpMyAdmin is open, the steps for renaming the table are the same as above, starting at step 3.
Update the application that uses the table
Renaming a table does not update anything that connects to it. If a website or application uses the table, update its configuration or code to use the new name. Otherwise it will show a "table doesn't exist" error.
For WordPress sites, a plugin or theme may use a fixed table name. Check its settings or documentation before you rename a table that WordPress uses.
Troubleshooting
- You cannot see the Operations tab: your database user may not have full rights. Check the user's privileges in the MySQL Databases tool in cPanel.
- A website shows a "table doesn't exist" error: the application is still using the old name. Update its configuration or code.
If you need help, contact Hostking support using live chat on the website or a support ticket from the client area.
