PHP, MySQL, JS, jQuery, Ajax, .htaccess,robots.txt,phponwebsites: Rename table in mysql

16 Jan 2014

Rename table in mysql

                       You can change the column name in mysql. Can you change table name in mysql. Yes you can rename mysql table. The mysql query for rename table is:

                       RENAME TABLE old_table_name TO new_name

Consider the following example: The table list in mysql database 'new' is below.


tables in mysql database

                   
                              Now we are going to change the table name 'table1' to table4. The mysql query as follows as:

                       RENAME TABLE table1 TO table4

Now your table list should be like this:


Rename mysql table


                          Now the table name 'table1' is changed into 'table4' in mysql

Related Post:
Change column name in mysql
Change column size in mysql table
Delete column in mysql table
Add column after specific field in mysql table
Move columns in mysql table

1 comment: