查看MySQL提供什么存储引擎:
mysql> show engines;
查看MySQL当前默认的存储引擎:
mysql> show variables like '%storage_engine%'; +----------------------------------+--------+ | Variable_name | Value | +----------------------------------+--------+ | default_storage_engine | InnoDB | | default_tmp_storage_engine | InnoDB | | disabled_storage_engines | | | internal_tmp_disk_storage_engine | InnoDB | +----------------------------------+--------+ 4 rows in set, 1 warning (0.01 sec)
创建表:
mysql> create table NEWS ( -> ID integer not null auto_increment, -> AUTHOR varchar(255), -> CONTENT varchar(255), -> CREATEDATE datetime, -> primary key (ID) -> ) ; Query OK, 0 rows affected (0.04 sec)
你要看 news 表用了什么引擎(在显示结果里参数engine后面的就表示该表当前用的存储引擎):
mysql> show create table news;1 row in set (0.01 sec)
将 news 表修为InnoDB存储引擎(也可以此命令将InnoDB换为MyISAM):
mysql> ALTER TABLE news ENGINE=INNODB;