What are these things?
A database is like a big filing cabinet that stores your website's information. A table is one drawer in that cabinet. For example, one table can hold all your users.
phpMyAdmin is a web tool that lets you look at and change databases with your mouse. You can open it from your hosting control panel.
Warning: Many apps, such as WordPress, look for tables by name. If you rename a table they use, your site may break. Take a backup first. In phpMyAdmin, use the Export tab to save a copy of your database.
Steps
- Log in to your hosting control panel.
- Open phpMyAdmin. Look in the Databases section.
- In the left list, click the name of your database.
- You will see all tables. Click the table you want to rename.
- Click the Operations tab at the top.
- Find the box named Table options. It has a field called Rename table to.
- Delete the old name and type the new name. Use letters, numbers and underscores. Avoid spaces.
- Click Go. phpMyAdmin shows a green message when it works.
Rename with a SQL command
SQL is the language used to talk to databases. You can also rename a table by typing a command in the SQL tab.
RENAME TABLE old_name TO new_name;
This command changes the table called old_name to new_name. Replace both words with your own names.
If your site breaks
- Rename the table back to its old name using the same steps.
- If a script uses the table, open its settings file and update the table name there too.
- Restore your backup if you cannot fix it.
Quick recap
- Back up your database first.
- Open phpMyAdmin and select the database and the table.
- Go to Operations and type the new name in Rename table to.
- Click Go.
- Update any app that still uses the old name.