mysql 复制表/字段

[ 2008-10-02 21:02:18 | Author: zhenhua ]
Font Size: Large | Medium | Small
Mysql 复制表及结构
一、CREATE TABLE 方法

整表复制 # create table 新表 select * from 旧表;
结构复制 # create table 新表 select * from 旧表 where 1 <>1;

二、INSERT INTO 方法

得到建表语句 # show create table 旧表;
新建表
复制数据到新表 # insert into 新表 select * from 旧表;
Comments Feed Comments Feed: http://www.zhenhua.org/feed.asp?q=comment&id=620
UTF-8 Encoding Trackback URL: http://www.zhenhua.org/trackback.asp?id=620

There is no comment on this article.

If you feel this site you find this information helpful, please click on the donation, which is voluntary,Thank you.
Post Comment
Smilies
[arrow] [biggrin] [confused] [cool]
[cry] [eek] [evil] [exclaim]
[frown] [idea] [lol] [mad]
[mrgreen] [neutral] [question] [razz]
[redface] [rolleyes] [sad] [smile]
[surprised] [twisted] [wink]
Enable UBB Codes
Auto Convert URL
Show Smilies
Hidden Comment
Username:   Password:   Register Now?
Security Code * Please Enter the Security Code