Home  >  Article  >  Database  >  mysql数据库之间表的复制语句_MySQL

mysql数据库之间表的复制语句_MySQL

WBOY
WBOYOriginal
2016-06-01 13:42:381048browse

bitsCN.com
mysql数据库之间表的复制 引用1.MySQL 5.1; 2.数据库db_1有一个表t_1; 3.还有一个数据库db_2; 4.把t_1复制到db_2;   进入MYSQL Command Line Client

输入:use db_2;进入db_2数据库 
Java代码  
CREATE TABLE t_1 LIKE db_1.t_1//复制表结构   
INSERT t_ SELECT * FROM db_1.t_1//复制表数据     作者 hanxin830311 bitsCN.com

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn