批量改数据表前缀

你妈青果  |  MySQL  |  445  |  2020-05-19 16:50:20


SELECT
    CONCAT(
        'ALTER TABLE ',
        table_name,
        ' RENAME TO new_prefix_',
        substring(table_name, 7),
        ';'
    )
FROM
    information_schema.crm_sys TABLES
WHERE
    table_name LIKE 'prefix_%'