#先创建一个数据库
create database ueb_order_2017;
#然后执行以下脚本命令
#!/bin/bash
user='root'
pass='123456'
tbs=`/usr/local/mysql/bin/mysql -u${user} -p${pass} -e "select TABLE_NAME from information_schema.TABLES where TABLE_SCHEMA='ueb_his' and TABLE_NAME like '%2017%';"`
for tb in $tbs
do
/usr/local/mysql/bin/mysql -u${user} -p${pass} -e "rename table ueb_his.${tb} to ueb_order_2017.${tb};"
done