Tuesday, November 19, 2024
HomeDatabaseMySQLRename or change name of MySQL table

Rename or change name of MySQL table

If you change your mind and want to rename an existing MySQL table, with or without data in it, it is no problem. One simple command will change the table’s name.


To change the name of an existing table first to second, use this command as a user with adequate privileges:

RENAME TABLE first TO second;

It is good DBA manners to make sure that no one and no program are using this table before making the name change.

Quinn McHenry
Quinn McHenry
Quinn was one of the original co-founders of Tech-Recipes. He is currently crafting iOS applications as a senior developer at Small Planet Digital in Brooklyn, New York.
RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

LATEST REVIEWS

Recent Comments

error: Content is protected !!