In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-31 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)05/31 Report--
This article mainly introduces "the usage of several built-in files in MySQL". In daily operation, I believe many people have doubts about the usage of several built-in files in MySQL. The editor consulted all kinds of materials and sorted out simple and easy-to-use operation methods. I hope it will be helpful to answer the doubts about the usage of several built-in files in MySQL. Next, please follow the editor to study!
The usage of several kinds of MySQL files
Log file
Log files are located in the data directory by default
Long_query_time=2
Log-slow-queries=
Log-error=
Log= C:\ log.log
Log-bin=
The function of mysql-bin.index file (binary log index) is to record the absolute path of all Binary Log to ensure that various threads of MySQL can successfully find all the needed Binary Log files according to it.
Data file
1. ".frm" file
The meta information related to the table is stored in the ".frm" file, including the definition information of the table structure, and so on. Regardless of the storage engine, each table has a ".frm" file named after the table. All ".frm" files are stored in the folder to which they belong.
2. ".MYD" file
The ".MYD" file is dedicated to the MyISAM storage engine and stores data from MyISAM tables. Each MyISAM table has a ".MYD" file corresponding to it, which is also stored in the folder of the database to which it belongs, along with the ".frm" file.
3. ".MYI" file
The ".MYI" file is also dedicated to the MyISAM storage engine and mainly stores the index-related information of the MyISAM table. For MyISAM storage, the content that can be cache is mainly from the ".myi" file. Each MyISAM table corresponds to a ".myi" file, which is stored in the same location as ".frm" and ".MYD".
4. ".ibd" file and ibdata file
These two kinds of files are files for storing Innodb data. The reason why there are two kinds of files to store Innodb data (including indexes) is that the data storage method of Innodb can be configured to decide whether to use shared table space to store data or exclusive table space to store data. Exclusive tablespace storage uses ".ibd" files to store data, and each table has an ".ibd" file, which is stored in the same location as MyISAM data. If you choose a shared storage tablespace to hold the data, the ibdata file is used for storage, and all tables share a single (or multiple, self-configurable) ibdata file. Ibdata files can be configured by the two parameters innodb_data_home_dir and innodb_data_file_path, innodb_data_home_dir configuration data storage directory, and innodb_data_file_path configuration of the name of each file. Of course, it may not be configured.
Innodb_data_home_dir uses the absolute path to complete the configuration directly when configuring the innodb_data_file_path parameter. You can configure multiple ibdata files at a time in innodb_data_file_path. Files can be of a specified size or auto-extended, but Innodb limits that only the last ibdata file can be configured as an auto-extension type. When we need to add a new ibdata file, it can only be added at the end of the innodb_data_file_path configuration, and we must restart MySQL to complete the ibdata addition. However, if we use exclusive tablespace storage, there will be no such problem, but if we want to use bare devices, one bare device for each table may result in a very large number of bare devices, and it is not easy to control the size. It is difficult to implement, while shared tablespaces do not have this problem, and it is easy to control the number of bare devices. Personally, I prefer to use exclusive tablespace storage.
Switch the engine used by the database
CREATE TABLE table name
(
Field.
) ENGINE=InnoDB
If it doesn't work, just go to the my.ini file in the MySQL directory to change the line default-storage-engine, change the default storage engine to InnoDB, and restart the database server.
Replication
1. Master.info file:
The master.info file exists in the data directory on the Slave side, which stores the relevant information of the Master side of the Slave, including the host address of the Master, the connection user, the connection password, the connection port, the current log location, the location of the log that has been read, and other information. Www.2cto.com
2. Relay log and relay log index
-the relay-bin.xxxxxn file is used to store the Binary Log information read by the Slave thread from the Master side, and then the SQL thread on the Slave side reads and parses the corresponding log information from the relay log, converts it into SQL statements executed by Master, and then applies it on the Slave side. The function of the mysql-relay-bin.index file is similar to mysql-bin.index, which is also the absolute path to the location where the log is stored, except that what he records is not Binary Log, but Relay Log.
3. Relay-log.info file:
Similar to master.info, it stores information that is written to the local relay log through the Slave's I _ swap O thread. SQL threads on the Slave side and some administrative operations can obtain information about the current replication at any time.
Pid file conf file socket file
At this point, the study of "the use of several built-in files in MySQL" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.