Rename a table in MySQL

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

Renaming a table is not working in MySQL

RENAME TABLE group TO member;

The error message is



        
16条回答
  •  旧时难觅i
    2020-12-04 07:16

    group is a keyword (part of GROUP BY) in MySQL, you need to surround it with backticks to show MySQL that you want it interpreted as a table name:

    RENAME TABLE `group` TO `member`;
    

    added(see comments)- Those are not single quotes.

提交回复
热议问题