Rename a table in MySQL

前端 未结 16 1315
逝去的感伤
逝去的感伤 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:19

    For Mysql 5.6.18 use the following command

    ALTER TABLE `old_table` RENAME TO `new_table`

    Also if there is an error saying ".... near RENAME TO ..." try removing the tick `

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

    Table name change

    RENAME TABLE old_table_name TO new_table_name;
    
    0 讨论(0)
  • 2020-12-04 07:21

    Running The Alter Command

    1.Click the SQL tab at the top.

    2.In the text box enter the following command: ALTER TABLE exampletable RENAME TO new_table_name;

    3.Click the go button.

    source : https://my.bluehost.com/hosting/help/2158

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

    Right Click on View > New Query

    And Type: EXEC sp_rename 'Table', 'NewName'

    Then Click on Run button at the top left corner of the page.

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

    Please try

    RENAME TABLE  `oldTableName` TO  `newTableName`
    
    0 讨论(0)
  • 2020-12-04 07:32

    The mysql query for rename table is

    Rename Table old_name TO new_name
    

    In your query, you've used group which one of the keywords in MySQL. Try to avoid mysql keywords for name while creating table, field name and so on.

    0 讨论(0)
提交回复
热议问题