Home > Database > Mysql Tutorial > mysql中用命令行复制表结构的方法_MySQL

mysql中用命令行复制表结构的方法_MySQL

WBOY
Release: 2016-06-01 13:40:25
Original
983 people have browsed it

bitsCN.com
mysql中用命令行复制表结构的方法 1.只复制表结构到新表 CREATE TABLE 新表 SELECT * FROM 旧表 WHERE 1=2 或CREATE TABLE 新表 LIKE 旧表  2.复制表结构及数据到新表 CREATE TABLE 新表 SELECT * FROM 旧表    3.复制旧表的数据到新表(假设两个表结构一样) INSERT INTO 新表 SELECT * FROM 旧表  4.复制旧表的数据到新表(假设两个表结构不一样) INSERT INTO 新表(字段1,字段2,.......) SELECT 字段1,字段2,...... FROM 旧表 bitsCN.com

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template