生活随笔
收集整理的這篇文章主要介紹了
MySQL查看和修改表的存储引擎
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
查看當前支持的存儲引擎
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:?10Row_format:?CompactRows:?2Avg_row_length:?8192Data_length:?16384
Max_data_length:?0Index_length:?0Data_free:?0Auto_increment:?3Create_time:?2015-07-21?10:51:48Update_time:?NULLCheck_time:?NULLCollation:?utf8_general_ciChecksum:?NULLCreate_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
轉載于:https://blog.51cto.com/yagetang/1676706
總結
以上是生活随笔為你收集整理的MySQL查看和修改表的存储引擎的全部內容,希望文章能夠幫你解決所遇到的問題。
如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。