MySQL storage engine InnoDB learning review file

Source: Internet
Author: User

1. Various types of files in the MySQL database and its storage engine InnoDB include:

Parameter files, log files, socket files, PID files, MySQL table structure files, storage engine files

2. parameter file

When a MySQL instance is started, it first reads some parameters in the configuration file to find the location of various database files and to specify some initialization parameters, these parameters usually define the setting information such as the memory structure size.

You can think of parameters as key-value pairs. You can use show variables to view all the parameters or use like to filter parameter names.

MySQL parameters can be divided into two types: Dynamic Parameters and static parameters. Dynamic parameters are set during MySQL instance running, static parameters indicate that they are neither needed nor modified throughout the life cycle of the MySQL instance. They seem to be read-only. You can use the set command to set dynamic parameters and set read_buffer_size.

3. Log Files

Common logs include error logs, binary logs, slow query logs, and query logs.

The error log records information during MySQL startup, running, and shutdown. When a problem occurs, you should first check the error log file, which not only records the error information, some warnings or correct information are recorded. You can use show variables like 'Log _ error' to locate the file.

4. Slow query of Files

Slow Query files bring benefits to optimizing SQL statements. You can set a threshold to record all SQL statements whose running time exceeds this threshold to slow query logs, the threshold value can be set through the long_query_time parameter. The default value is 10, indicating 10 s. By default, MySQL does not start the slow query log. You can set it through set.

5. binary log

Binary records all the operations that change the database, but does not include operations that do not change the database data such as select and show. For queries that do not change the data such as select and show, you can use query logs. Binary logs have two main functions: 1) recovery. Recovery of some data requires binary logs. For example, when a database is recovered from a full backup file (a fully backup file, point-in-time recovery can be performed using a binary file.

2) replication: By copying and executing binary files, one remote MySQL database and another database can be synchronized in real time.

6. Socket File

In a UNIX system, MySQL can be locally connected to MySQL through the Unix domain socket method. This socket can be controlled through the socket parameter, which is generally named mysql. Sock under/tmp /.

7. Table structure definition file

InnoDB Storage engine files, including redo log files and tablespace files

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.