Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What is the storage engine of MySQL database and what are the common commands?

2025-02-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

This article mainly introduces the MySQL database storage engine and commonly used commands which have a certain reference value, interested friends can refer to, I hope you can learn a lot after reading this article, the following let the editor with you to understand.

What are the categories of storage engines for MySQL databases

MyISAM is non-transactional secure, while InnoDB is transactional secure.

The granularity of MyISAM locks is table-level, while InnoDB supports row-level locking.

MyISAM supports full-text indexing while InnoDB does not support full-text indexing.

MyISAM is relatively simple, so it is better than InnoDB in efficiency, and small applications can consider using MyISAM.

MyISAM table is saved as a file, so using MyISAM storage in cross-platform data transfer will save a lot of trouble.

InnoDB tables are more secure than MyISAM tables and can switch from non-transactional tables to transactional tables (altertabletablenametype=innodb) without losing data.

Application scenario of Storage engine for MySQL Database

MyISAM manages non-transactional tables. It provides high-speed storage and retrieval, as well as full-text search capabilities. If you need to execute a large number of SELECT queries in your application, then MyISAM is a better choice.

InnoDB is used in transactional applications and has many features, including ACID transaction support. If you need to perform a large number of INSERT or UPDATE operations in your application, you should use InnoDB, which can improve the performance of multi-user concurrent operations.

What are the commands commonly used in the storage engine of MySQL database

1. Look at the storage types of the watch (three):

Showcreatetabletablenameshowtablestatusfromdbnamewherename=tablenamemysqlshow-uuser-ppassword--statusdbnametablename

two。 Modify the storage engine of the table:

Altertabletablenametype=InnoDB

3. Add the following parameters to the command line that starts the mysql database so that all newly published tables use transactions by default:

Default-table-type=InnoDB

4. Temporarily change the default table type:

Settable_type=InnoDBshowvariableslike'table_type'

Thank you for reading this article carefully. I hope the article "Storage engine of MySQL database and what are the commonly used commands" shared by the editor will be helpful to you. At the same time, I also hope you will support us and pay attention to the industry information channel. More related knowledge is waiting for you to learn!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report