标签:查看当前支持的存储引擎
查看当前支持的存储引擎
mysql> show engines;
+--------------------+---------+----------------------------------------------------------------+--------------+------+------------+ | Engine | Support | Comment | Transactions | XA | Savepoints | +--------------------+---------+----------------------------------------------------------------+--------------+------+------------+ | MRG_MYISAM | YES | Collection of identical MyISAM tables | NO | NO | NO | | CSV | YES | CSV storage engine | NO | NO | NO | | MyISAM | YES | MyISAM storage engine | NO | NO | NO | | BLACKHOLE | YES | /dev/null storage engine (anything you write to it disappears) | NO | NO | NO | | MEMORY | YES | Hash based, stored in memory, useful for temporary tables | NO | NO | NO | | PERFORMANCE_SCHEMA | YES | Performance Schema | NO | NO | NO | | ARCHIVE | YES | Archive storage engine | NO | NO | NO | | FEDERATED | NO | Federated MySQL storage engine | NULL | NULL | NULL | | InnoDB | DEFAULT | Supports transactions, row-level locking, and foreign keys | YES | YES | YES | +--------------------+---------+----------------------------------------------------------------+--------------+------+------------+
2.查看表使用的存储引擎
mysql> show table status from 数据库 where name=‘表名‘ \G #方法一 *************************** 1. row *************************** Name: 表名 Engine: InnoDB #存储引擎类型 Version: 10 Row_format: Compact Rows: 2 Avg_row_length: 8192 Data_length: 16384 Max_data_length: 0 Index_length: 0 Data_free: 0 Auto_increment: 3 Create_time: 2015-07-21 10:51:48 Update_time: NULL Check_time: NULL Collation: utf8_general_ci Checksum: NULL Create_options: Comment: mysql> show create table test \G #方法二 *************************** 1. row *************************** Table: test Create Table: CREATE TABLE `test` ( `tid` int(11) DEFAULT NULL, `tname` char(30) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=utf8
3.修改表引擎方法
mysql> alter table test engine=innodb;
4.设置默认引擎
1)修改配置文件my.cnf中的 [mysqld]选项 加入 default-storage-engine=INNODB #设置innodb为默认引擎
2)重启mysql服务器:
#mysqladmin -u root -p shutdown
或者
#service mysqld restart
本文出自 “Home_Tang” 博客,请务必保留此出处http://yagetang.blog.51cto.com/1780698/1676706
标签:查看当前支持的存储引擎
原文地址:http://yagetang.blog.51cto.com/1780698/1676706