Rename a table in MySQL

前端 未结 16 1314
逝去的感伤
逝去的感伤 2020-12-04 07:08

Renaming a table is not working in MySQL

RENAME TABLE group TO member;

The error message is



        
相关标签:
16条回答
  • 2020-12-04 07:33
    ALTER TABLE old_table_name RENAME new_table_name;
    

    or

    RENAME TABLE old_table_name TO new_table_name;
    
    0 讨论(0)
  • 2020-12-04 07:35
    ALTER TABLE `group` RENAME `member`
    

    group is keyword so you must have to enclose into group

    0 讨论(0)
  • 2020-12-04 07:35

    Without giving the database name the table is can't be renamed in my case, I followed the below command to rename the table.

    RENAME TABLE current_db.tbl_name TO current_db.tbl_name;
    
    0 讨论(0)
  • 2020-12-04 07:37

    Rename a table in MySQL :

    ALTER TABLE current_name RENAME new_name;
    
    0 讨论(0)
提交回复
热议问题