一、获取old表所有字段
SELECT GROUP_CONCAT(COLUMN_NAME SEPARATOR ",") FROM information_schema.COLUMNS
WHERE TABLE_SCHEMA = 'database_name' AND TABLE_NAME = 'table_name'
二、将old表数据批量插入new表
INSERT INTO newdatabase_name.table_name(
步骤一获取的所有字段
)
SELECT
步骤一获取的所有字段
FROM olddatabase_name.table.name;