mysql同实例下移动表

mysql同实例下移动表

# 在数据库中移动表
mysql> create database prod;
mysql> create table prod.audit_log(id int not null, msg varchar(64));
mysql> create database archive;
# 如何操作
你想把audit_log表重命名为audit_log_archive_2018

use prod;
rename table audit_log to audit_log_archive_2018;

# 希望将这张表移动到另外一个库,使用点记法
use prod;
rename table audit_log_archive_2018 to archive.audit_log;
原文地址:https://www.cnblogs.com/bjx2020/p/12120177.html