MySQL ALTER TABLE: rename table

Profile picture for user arilio666

We can rename the table name with the alter clause and use the RENAME clause in MySQL.

Syntax

ALTER TABLE TableName RENAME TO NewTableName;

Example

Let us change the name of the table in our database called movies to movies_list.

This is our movies table.

ALTER TABLE movies RENAME TO movies_list;

As you can see using the following query we can simply rename the table name in our database.

Tags