How do I view the current storage engine for MySQL?

Source: Internet
Author: User
Tags table definition mysql view

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 (); What is the difference between the 3 storage engines of the   mysql database? 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.   ================================================== Modify MySQL's default storage engine  1, view MySQL storage engine commands, mysql> Prompt to enter show engines; Field Support is: default meansNBSP; 2, set INNODB as the default engine: In the configuration file my.cnf, under [mysqld], add default-storage-engine=innodb a sentence  3, Restart MySQL server: mysqladmin-u root-p shutdown or service mysqld restart log in to the MySQL database   mysql view and modify the table's storage engine 1 View the storage engines supported by the System 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 tab Le_name; If the displayed format is not good, you can use \g instead of the end of line semicolon some people say that using the second method is inaccurate, I tried to shut down the original default InnoDB engine cannot execute the show CREATE TABLE table_name instruction at all, Because the InnoDB table was previously built, it was turned off by default with the MyISAM engine, resulting in 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

How do I view the current storage engine for MySQL?

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.