Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • How to rename a table in MySQL?

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 238
    Comment on it

    To rename a table in MySQL you need to execute the following command:

    RENAME TABLE old_table_name TO new_table_name;
    

    The old_table_name must exist n the database and the new_table_name must not. For example, we have a table name demo and we want to change its name as demo1. So we will execute the following MySQL statement to rename it:

    RENAME TABLE demo TO demo1
    You can also rename multiple tables using RENAME TABLE statement in MySQL as follows:
    RENAME TABLE old_table_name_1 TO new_table_name_2,
                 old_table_name_2 TO new_table_name_2,...
    

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: