How do I quickly rename a MySQL database (change schema name)?

前端 未结 30 2828
余生分开走
余生分开走 2020-11-22 14:54

The MySQL manual at MySQL covers this.

Usually I just dump the database and reimport it with a new name. This is not an option for very big databases. Apparently

30条回答
  •  说谎
    说谎 (楼主)
    2020-11-22 15:02

    I think the solution is simpler and was suggested by some developers. phpMyAdmin has an operation for this.

    From phpMyAdmin, select the database you want to select. In the tabs there's one called Operations, go to the rename section. That's all.

    It does, as many suggested, create a new database with the new name, dump all tables of the old database into the new database and drop the old database.

    Enter image description here

提交回复
热议问题