MySQL View and modify the table's storage engine

Source: Internet
Author: User

    1. View the currently supported storage engines

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. View the storage engine used by the table

mysql> show table status from  database  where name= ' table name '  \G  # Method One *************************** 1. row ***************************            Name:  Table name          engine:  InnoDB   #存储引擎类型         Version: 10      Row_format: Compact            Rows: 2 avg_row_length: 8192    data_length: 16384max_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:  testcreate table: create table  ' Test '   (   ' tid '  int (one)  default  NULL,   ' Tname '  char ( default null)  ENGINE=MyISAM DEFAULT  Charset=utf8

3. Modifying the Table engine method

mysql> ALTER TABLE Test ENGINE=INNODB;

4. Setting the default engine

1) Modify the [mysqld] option in the configuration file my.cnf to add Default-storage-engine=innodb #设置innodb为默认引擎

2) Restart the MySQL server:

#mysqladmin-U root-p shutdown

Or

#service mysqld Restart


This article is from the "Home_tang" blog, make sure to keep this source http://yagetang.blog.51cto.com/1780698/1676706

MySQL View and modify the table's storage engine

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.