傻瓜化手動指定innodb
阿新 • • 發佈:2018-12-03
mysql> use bbs_user; Database changed mysql> create table one( -> id int unsigned not null auto_increment primary key, -> username varchar(32) -> ); Query OK, 0 rows affected (0.01 sec) mysql> show create table one; +-------+----------------------------------------------------------------------- -------------------------------------------------------------------------------- -----------------+ | Table | Create Table | +-------+----------------------------------------------------------------------- -------------------------------------------------------------------------------- -----------------+ | one | CREATE TABLE `one` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `username` varchar(32) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 | +-------+----------------------------------------------------------------------- -------------------------------------------------------------------------------- -----------------+ 1 row in set (0.01 sec) mysql> create table two( -> id int unsigned not null auto_increment primary key, -> username varchar(32) -> )engine=innodb default charset=utf8; Query OK, 0 rows affected (0.02 sec) mysql> show create table two; +-------+----------------------------------------------------------------------- -------------------------------------------------------------------------------- -----------------+ | Table | Create Table | +-------+----------------------------------------------------------------------- -------------------------------------------------------------------------------- -----------------+ | two | CREATE TABLE `two` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `username` varchar(32) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 | +-------+----------------------------------------------------------------------- -------------------------------------------------------------------------------- -----------------+ 1 row in set (0.00 sec)
主要是自己沒有學會更改innodb設定 手動設定myisam=innodb 還挺有意思;