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);

    • 1 Users Found This Useful
    Was this answer helpful?

    Related Articles

    How to Backup your MySQL DB databases

    Backup command for mysql databases For those looking to get a regular backup of your MySQL...

    How do I create a MySQL database in Cpanel ?

    MySQL databases can be created through the cpanel control panel: Login to your control panel...

    How do I create a MySQL database in Plesk ?

    MySQL databases can be created through the plesk control panel: Login to your control panel...

    How do I repair a damaged MySQL table, rebuild index or prepare for backup ?

    It is always worth trying a repair of MySQL tables before backing them up to shrink the...

    How do I create a MySQL Database in the Ensim control panel ?

    To add a database (subject to hosting plan resources available) through your Ensim control panel:...

    Powered by WHMCompleteSolution