PHP, MySQL, Drupal, .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:

1 comment: