JDP 發表於 2018-8-23 09:39:45

修改Table prefix

SET @database   = "database_name";
SET @old_prefix = "old_prefix_";
SET @new_prefix = "new_prefix_";

SELECT
    concat(
      "RENAME TABLE ",
      TABLE_NAME,
      " TO ",
      replace(TABLE_NAME, @old_prefix, @new_prefix),
      ';'
    ) AS "SQL"
FROM information_schema.TABLES WHERE TABLE_SCHEMA = @database;
Reference: https://richjenks.com/change-mysql-database-table-prefix/
頁: [1]
查看完整版本: 修改Table prefix