How to change a MySQL database’s table prefix | Rich Jenks
▻https://richjenks.com/change-mysql-database-table-prefix
The output will be a series of SQL queries that will rename the tables for you
❝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;❞