show engines; +------------+---------+----------------------------------------------------------------+ | Engine | Support | Comment | +------------+---------+----------------------------------------------------------------+ | MyISAM | YES | Default engine as of MySQL 3.23 with great performance | | MEMORY | YES | Hash based, stored in memory, useful for temporary tables | | InnoDB | DEFAULT | Supports transactions, row-level locking, and foreign keys | | BerkeleyDB | YES | Supports transactions and page-level locking | | BLACKHOLE | NO | /dev/null storage engine (anything you write to it disappears) | | EXAMPLE | NO | Example storage engine | | ARCHIVE | NO | Archive storage engine | | CSV | NO | CSV storage engine | | ndbcluster | NO | Clustered, fault-tolerant, memory-based tables | | FEDERATED | NO | Federated MySQL storage engine | | MRG_MYISAM | YES | Collection of identical MyISAM tables | | ISAM | NO | Obsolete storage engine | +------------+---------+-------------------------------------
DEFAULT 为默认引擎。
在 /etc/my.cnf 中修改默认存储引擎
2. 设置InnoDB为默认引擎:在配置文件my.cnf中的 [mysqld] 下面加入default-storage-engine=INNODB 一句,保存。
3. 重启mysql服务器:mysqladmin -u root -p shutdown或者service mysqld restart 登录mysql数据库,在mysql>提示符下搞入show engines;命令。如果出现 InnoDB |DEFAULT,则表示我们 设置InnoDB为默认引擎成功。
改变现有的表引擎:
ALTER TABLE engineTest ENGINE = INNODB;
查看修改后的状态:
show table status from test like '%tbName%' ;
|