MySQL View and modify the table's storage engine

Source: Internet
Author: User
Tags table definition mysql view

How do I view the current storage engine for MySQL? In general, MySQL will default to provide a variety of storage engines, you can see through the following:  your MySQL now provides what storage engine:mysql> show engines;  See your MySQL current default storage engine: MySQL > Show variables like '%storage_engine% ';  you want to see what engine the table uses (the storage engine that is behind the parameter engine in the display):mysql> show create Table name;   How to view the version amount system function on the MySQL server AH Select version ();  code is handsome  mysql database 3 kinds of storage engine what is the difference? This is a consideration of performance issues, as well as the support of the business, bar   Baidu you know  myisam, InnoDB, Heap (Memory), ndb   seems to be generally used   InnoDB,  MySQL's storage engine includes: MyISAM, InnoDB, BDB, Memory, MERGE, EXAMPLE, Ndbcluster, ARCHIVE, CSV, blackhole, federated, etc. where InnoDB and BDB provide transaction security tables, other storage engines are non-transactional security tables. The 2 most commonly used storage engines: 1.Myisam is the default storage engine for MySQL, and MyISAM is used by default when create creates a new table without specifying the storage engine for the new table. Each myisam is stored as three files on disk. The file name is the same as the table name, and the extension is. frm (store table definition), respectively. MYD (MYData, storing data),. MYI (myindex, storage index). Data files and index files can be placed in different directories, evenly distributed IO, for faster speeds. The 2.InnoDB storage Engine provides transactional security with commit, rollback, and crash resiliency. However, compared to the MyISAM storage engine, InnoDB writes are less efficient and consume more disk space to preserve data and indexes.   Don't know if it's helpful to you   questioner rating Thank you!  ================================================== Modify MySQL's default storage engine  1, view MySQL storage engine commands, mysql>Show engines under an indicator; Field Support is: default represents the defaults storage engine    www.2cto.com  2, setting InnoDB as the default engine: in configuration file my.cnf [mysqld] Add the following default-storage-engine=innodb a  3, restart the MySQL server: mysqladmin-u root-p shutdown or service mysqld restart Log in to MySQL database   mysql view and modify table Storage Engine 1 View system supported Storage engine show engines;2 view table using the storage engine two methods: A, Show table status from Db_name where name= ' table_name '; B, show create TABLE table_name; If the displayed format is not good-looking, you can use the \g instead of the end of line semicolon someone said the second method is inaccurate, I tried, The show CREATE TABLE table_name instruction cannot be executed after shutting down the original default InnoDB engine because the InnoDB table was previously built, and the MyISAM engine is used by default when it is turned off, resulting in the InnoDB table data not being read correctly. 3 Modifying the table engine method, ALTER TABLE table_name ENGINE=INNODB;4 shutdown InnoDB engine method shutdown MySQL service: net stop MySQL find the My.ini file in the MySQL installation directory: Find Default-storage-engine=innodb instead Default-storage-engine=myisam find #skip-innodb Change to skip-innodb start MySQL service: net start mysql 

MySQL view and modify the table's storage engine

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.