Share on Google+Share on Google+

How to rename MySQL table?

Advertisement
In this section you will learn how to rename MySQL table.

How to rename MySQL table?

The designing and development of any software system is a continuous process and you might give a wrong name to a table. After a review you many have to change the name of database. The MySQL database provide appropriate sql command to change the database name.

The alter table <table name> rename <new table name> command can be used to rename the table.

Suppose you have a table called called account and now you have to change it to loan_account then you can use the following command to change the table name.

alter table account rename loan_account;

The above command will rename the table account to loan_account.

Advertisements

Posted on: July 12, 2010 If you enjoyed this post then why not add us on Google+? Add us to your Circles

Share this Tutorial Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.