MySQL Rename Table

I’ve had to recently update a few table names with a different name. I’ve never actually needed to do this before so was a bit worried about whether it could be done at all. Turns out you can! The syntax is quite simple –

The RENAME TABLE command will rename the table without regard for anything; keep in mind that your table will be locked during the execution of this command

You can also rename more than one table in one command –

You will also need to make sure that you have permission to ALTER, DROP, CREATE and INSERT.

I love how nice and simple it is!

Tagged with:
Posted in MySQL

Leave a Reply