Filed under:

MySQL Alter Table - How to rename table names and column names in mysql ?




If you have access to a web administration tool like phpAdmin then you can use that to rename (alter) table and column names.
TAKE A BACKUP FIRST

To update the definition of a database table directly through MySQL then ...
TAKE A BACKUP FIRST

How to Rename an MySQL Table

  • RENAME TABLE oldtable_name TO newtable_name;

    How to Rename a MySQL Column

  • ALTER TABLE table_name CHANGE oldcolumn_name newcolumn_name oldtype(oldsize);

    How to Change the type/definition of a MySQL Column

  • ALTER TABLE table_name CHANGE column_name column_name newtype(newsize);



  • Was this answer helpful?

    Add to Favourites Add to Favourites    Print this Article Print this Article

    Also Read
    article icon What is phpMyAdmin? (Views: 2019)

    Language: