

1. 创建出新库名:
代码如下:
mysql>create database db_v2;
代码如下:
mysql>select concat("rename table ",table_schema,".",table_name," to db_v2.",table_name,";") into outfile '/tmp/rename_to_db_v2.sql' from information_schema.tables where table_schema='sbtest';
代码如下:
mysql>source /tmp/rename_to_db_v2.sql
