How do I view the current storage engine for MySQL?

Source: Internet
Author: User
Tags table definition mysql view

In general, MySQL will provide a variety of storage engines by default, which you can view by:

See what storage engine your MySQL has now provided:
Mysql> show engines;

Look at your MySQL current default storage engine:
Mysql> Show variables like '%storage_engine% ';

You want to see what engine the table is using (in the results, the storage engine that the table is currently using is the one behind the parameter engine):
Mysql> Show create table table name;

How to view versions on a MySQL server
The frontal system function.
Select version ();

The code is handsome.

What is the difference between the 3 storage engines of MySQL database?
This is a consideration of performance issues, as well as the support of the business, you know, Baidu a bit

MyISAM, InnoDB, Heap (Memory), NDB

It seems that the general use of 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.

I don't know if it's going to help you.

Questioner Rating Thank you!

==================================================
Modify the default storage engine for MySQL

1. View MySQL storage engine commands,
Enter show engines at the mysql> prompt;
The field Support is: default represents the defaults storage engine
Www.2cto.com
2. Set InnoDB as the default engine:
In configuration file my.cnf, under [mysqld], add
Default-storage-engine=innodb a sentence

3. Restart the 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 Viewing system-supported storage engines
Show engines;
2 Viewing the storage engine used by the table
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 \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.
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

Marking:
If it is MyISAM, backup data should be backed up in MySQL corresponding directory data in the corresponding library data can be;

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.