CREATE TABLE T_1(ID SMALLINT,NAME VARCHAR(32)) ENGINE='MYISAM';
create table t_2 (id smallint,name varchar(32)) ENGINE=innodb default charset=utf8;
查看建表语句:
mysql> show create table T;
+-------+----------------------------------------------------------------------------------------+
| Table | Create Table |
+-------+-----------------------------------------------------------------------------------------+
| T | CREATE TABLE `T` (
`id` smallint(6) DEFAULT NULL,
`name` varchar(32) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 |
+-------+------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)
mysql> show create table T_1;
+-------+-------------------------------------------------------------------------------------------------------+
| Table | Create Table |
+-------+-------------------------------------------------------------------------------------------------------+
| T_1 | CREATE TABLE `T_1` (
`ID` smallint(6) DEFAULT NULL,
`NAME` varchar(32) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 |
+-------+-------------------------------------------------------------------------------------------------------+
mysql> show create table t_2;
+-------+--------------------------------------------------------------------------------------------------------+
| Table | Create Table |
+-------+---------------------------------------------------------------------------------------------------------+
| t_2 | CREATE TABLE `t_2` (
`id` smallint(6) DEFAULT NULL,
`name` varchar(32) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 |
mysql> show table status from db;
Mysql里的引擎是可以改的,更改语句如下:
mysql> alter table T_1 engine=innodb;
Query OK, 0 rows affected (0.02 sec)