MySQL View and modify table storage engine (reprint + add something)

Source: Internet
Author: User
Tags mysql view

1 Viewing system-supported storage engines

Show engines;

2 Viewing the storage engine used by the table

Two methods:
A, Show table status from your_db_name where name= 'your_table_name';
b, show create TABLE your_table_name;
If the displayed format is not good-looking, you can use \g instead of the end of line semicolon

Some people say that using the second method is not accurate, I tried to shut down the original default InnoDB engine is not able to execute the show CREATE TABLE table_name instruction, because it was built InnoDB table, after the default with the MyISAM engine, Causes the InnoDB table data to not be read correctly.

The right way:

Show table status from Db_name where name= ' table_name ';

+------+--------+---------+------------+------+----------------+-------------+-----------------+

| Name | Engine | Version | Row_format | Rows | Avg_row_length | Data_length |

+---------+------------+------+----------------+-------------+-----------------+--------------+

| T |      InnoDB | 10 |    Compact |           3 |       5461 |               16384 | 0 |

+------+--------+---------+------------+------+----------------+-------------+-----------------+

Incorrect method:

Show CREATE TABLE table_name;

+-------+-----------------------------------------------------------------------------------------+
| Table | Create Table |
+-------+-----------------------------------------------------------------------------------------+
| T | CREATE TABLE ' t ' (
' VC ' varchar (1) DEFAULT NULL,
' C ' char (1) DEFAULT NULL,
KEY ' C ' (' C ')
) Engine=innodb DEFAULT Charset=utf8 |
+-------+------------------------------------------------------------------------------------------+

If Mysqld does not start the corresponding engine as InnoDB here, then the default MyISAM engine will be used, so it is inaccurate.

3 Modifying the Table engine method
ALTER TABLE table_name ENGINE=INNODB;

4 shutting down the InnoDB engine method
Turn off MySQL service: net stop MySQL
Locate the My.ini file in the MySQL installation directory:
Find Default-storage-engine=innodb instead of Default-storage-engine=myisam
Find #skip-innodb instead of Skip-innodb
Start MySQL service: net start MySQL

MySQL View and modify table storage engine (reprint + add something)

Related Article

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.