Renaming a Table

Hi All,

Is it possible to rename a table in a database without loosing any data?

I have a name which was OK when I first started but now it makes more sense to rename the table with a more appropriate name. Yes, it would require changing a lot in the script-- but as a hypothetical?


try the RENAME TABLE command

MySQL Manual :: RENAME TABLE Syntax

The MySQL manual is good, you should check there when you have basic questions about MySQL

Thanks -

I was just nervous about loosing data… but the mysql docs don’t say that any data will be lost.


You keep regular backups anyway, right? :wink: