I'm trying to copy a table with sample records using this syntax: (mysql 4.1)
It works, but it creates the table as default MyISAM for all tables even if the table I copied from is an InnoDB table. I'm trying to avoid using mysqldump since I want a limited number of records copied from the source table. Also, I notice that PK, and other keys are not also copied.
Is there a way to copy the table as is?
Here are some ddl dumps to compare:
Original:
Test:
Code:
CREATE TABLE mytest.alert_reason_1 select * from urldb2.alert_reason_1 limit 10;
It works, but it creates the table as default MyISAM for all tables even if the table I copied from is an InnoDB table. I'm trying to avoid using mysqldump since I want a limited number of records copied from the source table. Also, I notice that PK, and other keys are not also copied.
Is there a way to copy the table as is?
Here are some ddl dumps to compare:
Original:
Code:
CREATE TABLE `alert_reason_1` (
`ar_id` int(11) NOT NULL auto_increment,
`a_id` int(10) unsigned NOT NULL default '0',
`rule_name` varchar(20) NOT NULL default '',
`user` varchar(128) default NULL,
`vote_count` int(11) NOT NULL default '0',
`vote_v_volumn` float default NULL,
`comment` text,
PRIMARY KEY (`a_id`),
UNIQUE KEY `ar_id` (`ar_id`),
KEY `rule` (`rule_name`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
Test:
Code:
CREATE TABLE `alert_reason_1` (
`ar_id` int(11) NOT NULL default '0',
`a_id` int(10) unsigned NOT NULL default '0',
`rule_name` varchar(20) NOT NULL default '',
`user` varchar(128) default NULL,
`vote_count` int(11) NOT NULL default '0',
`vote_v_volumn` float default NULL,
`comment` text
) ENGINE=MyISAM DEFAULT CHARSET=latin1;