Home Database Mysql Tutorial MySQL几种文件的用法_MySQL

MySQL几种文件的用法_MySQL

Jun 01, 2016 pm 01:41 PM
Record

bitsCN.com
MySQL几种文件的用法 日志文件日志文件默认位于data目录下long_query_time=2log-slow-queries= log-error=log= C:/log.loglog-bin=  mysql-bin.index 文件(binary log index)的功能是记录所有Binary Log 的绝对路径,保证MySQL 各种线程能够顺利的根据它找到所有需要的Binary Log 文件。   数据文件1、“.frm”文件与表相关的元数据(meta)信息都存放在“.frm”文件中,包括表结构的定义信息等。不论是什么存储引擎,每一个表都会有一个以表名命名的“.frm”文件。所有的“.frm”文件都存放在所属数据库的文件夹下面。2、“.MYD”文件“.MYD”文件是MyISAM 存储引擎专用,存放MyISAM 表的数据。每一个MyISAM 表都会有一个“.MYD”文件与之对应,同样存放于所属数据库的文件夹下,和“.frm”文件在一起。3、“.MYI”文件“.MYI”文件也是专属于MyISAM 存储引擎的,主要存放MyISAM 表的索引相关信息。对于MyISAM 存储来说,可以被cache 的内容主要就是来源于“.MYI”文件中。每一个MyISAM表对应一个“.MYI”文件,存放于位置和“.frm”以及“.MYD”一样。
 4、“.ibd”文件和ibdata 文件这两种文件都是存放Innodb 数据的文件,之所以有两种文件来存放Innodb 的数据(包括索引),是因为Innodb 的数据存储方式能够通过配置来决定是使用共享表空间存放存储数据,还是独享表空间存放存储数据。独享表空间存储方式使用“.ibd”文件来存放数据,且每个表一个“.ibd”文件,文件存放在和MyISAM 数据相同的位置。如果选用共享存储表空间来存放数据,则会使用ibdata 文件来存放,所有表共同使用一个(或者多个,可自行配置)ibdata 文件。ibdata 文件可以通过innodb_data_home_dir 和innodb_data_file_path两个参数共同配置组成, innodb_data_home_dir 配置数据存放的总目录, 而innodb_data_file_path 配置每一个文件的名称。当然, 也可以不配置    
 innodb_data_home_dir 而直接在innodb_data_file_path 参数配置的时候使用绝对路径来完成配置。innodb_data_file_path 中可以一次配置多个ibdata 文件。文件可以是指定大小,也可以是自动扩展的,但是Innodb 限制了仅仅只有最后一个ibdata 文件能够配置成自动扩展类型。当我们需要添加新的ibdata 文件的时候,只能添加在innodb_data_file_path配置的最后,而且必须重启MySQL 才能完成ibdata 的添加工作。不过如果我们使用独享表空间存储方式的话,就不会有这样的问题,但是如果要使用裸设备的话,每个表一个裸设备,可能造成裸设备数量非常大,而且不太容易控制大小,实现比较困难,而共享表空间却不会有这个问题,容易控制裸设备数量。我个人还是更倾向于使用独享表空间存储方式。切换数据库使用的引擎CREATE TABLE 表名( 字段…… ) ENGINE=InnoDB 如果还不行,就直接到MySQL目录里的my.ini文件中把default-storage-engine这一行改过来,把默认的存储引擎改为InnoDB,重启数据库服务器就行了。 Replication1、master.info 文件:master.info 文件存在于Slave 端的数据目录下,里面存放了该Slave 的Master 端的相关信息,包括Master 的主机地址,连接用户,连接密码,连接端口,当前日志位置,已经读取到的日志位置等信息。    2、relay log 和relay log indexmysql-relay-bin.xxxxxn 文件用于存放Slave 端的I/O 线程从Master 端所读取到的Binary Log 信息,然后由Slave 端的SQL 线程从该relay log 中读取并解析相应的日志信息,转化成Master 所执行的SQL 语句,然后在Slave 端应用。mysql-relay-bin.index 文件的功能类似于mysql-bin.index ,同样是记录日志的存放位置的绝对路径,只不过他所记录的不是Binary Log,而是Relay Log。
 3、relay-log.info 文件:类似于master.info,它存放通过Slave 的I/O 线程写入到本地的relay log 的相关信息。供Slave 端的SQL 线程以及某些管理操作随时能够获取当前复制的相关信息。pid file  conf file  socket file  作者 bengda bitsCN.com

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Where can I view the records of things I have purchased on Pinduoduo? How to view the records of purchased products? Where can I view the records of things I have purchased on Pinduoduo? How to view the records of purchased products? Mar 12, 2024 pm 07:20 PM

Pinduoduo software provides a lot of good products, you can buy them anytime and anywhere, and the quality of each product is strictly controlled, every product is genuine, and there are many preferential shopping discounts, allowing everyone to shop online Simply can not stop. Enter your mobile phone number to log in online, add multiple delivery addresses and contact information online, and check the latest logistics trends at any time. Product sections of different categories are open, search and swipe up and down to purchase and place orders, and experience convenience without leaving home. With the online shopping service, you can also view all purchase records, including the goods you have purchased, and receive dozens of shopping red envelopes and coupons for free. Now the editor has provided Pinduoduo users with a detailed online way to view purchased product records. method. 1. Open your phone and click on the Pinduoduo icon.

How to view and manage Linux command history How to view and manage Linux command history Aug 01, 2023 pm 09:17 PM

How to View Command History in Linux In Linux, we use the history command to view the list of all previously executed commands. It has a very simple syntax: history Some options for pairing with the history command include: Option description -c clears the command history for the current session -w writes the command history to a file -r reloads the command history from the history file -n Limit the number of output of recent commands Simply run the history command to see a list of all previously executed commands in a Linux terminal: In addition to viewing command history, you can also manage command history and perform modifications to previously executed commands , reverse search command history or even delete history completely

How to check call history in iPhone and export it? How to check call history in iPhone and export it? Jul 05, 2023 pm 12:54 PM

Call recording in iPhone is often underestimated and is one of the most critical features of iPhone. With its simplicity, this feature is of vital importance and can provide important insights about the calls made or received on the device. Whether for work purposes or legal proceedings, the ability to access call records can prove invaluable. In simple terms, call history refers to the entries created on your iPhone whenever you make or receive a call. These logs contain key information, including the contact's name (or number if not saved as a contact), timestamp, duration, and call status (dialed, missed, or not answered). They are a concise record of your communication history. Call history includes call history strips stored on your iPhone

How to view your medication log history in the Health app on iPhone How to view your medication log history in the Health app on iPhone Nov 29, 2023 pm 08:46 PM

iPhone lets you add medications to the Health app to track and manage the medications, vitamins and supplements you take every day. You can then log medications you've taken or skipped when you receive a notification on your device. After you log your medications, you can see how often you took or skipped them to help you track your health. In this post, we will guide you to view the log history of selected medications in the Health app on iPhone. A short guide on how to view your medication log history in the Health App: Go to the Health App>Browse>Medications>Medications>Select a Medication>Options&a

C# Development Advice: Logging and Monitoring Systems C# Development Advice: Logging and Monitoring Systems Nov 22, 2023 pm 08:30 PM

C# Development Suggestions: Logging and Monitoring System Summary: In the software development process, logging and monitoring systems are crucial tools. This article will introduce the role and implementation suggestions of logging and monitoring systems in C# development. Introduction: Logging and monitoring are essential tools in large-scale software development projects. They can help us understand the running status of the program in real time and quickly discover and solve problems. This article will discuss how to use logging and monitoring systems in C# development to improve software quality and development efficiency. The role of logging system

How to log and monitor Java development projects How to log and monitor Java development projects Nov 03, 2023 am 10:09 AM

How to log and monitor Java development projects 1. Background introduction With the rapid development of the Internet, more and more companies have begun to develop Java and build various types of applications. In the development process, logging and monitoring are an important link that cannot be ignored. Through logging and monitoring, developers can discover and solve problems in time to ensure the stability and security of applications. 2. The importance of logging 1. Problem tracking: When an application error occurs, logging can help us quickly locate the problem.

How to clear history on iPhone How to clear history on iPhone Jun 29, 2023 pm 01:13 PM

How to clear iPhone history in Safari? To clear your browsing and search history on Apple's Safari, you need to open the Settings app on your device. After selecting Settings, you need to scroll down and select Safari, then another menu will appear and you need to select Clear History and Website Data. You now need to select Clear History and Data from the menu, which will delete all search history, browsing history, cookies, and data from Apple’s Safari browser. That's it, all your previous browsing history and search history are now deleted from Safari. If you don’t want to delete all search history in Safari

How to record running kilometers in keep? Where is the running track recorded? How to record running kilometers in keep? Where is the running track recorded? Mar 12, 2024 am 11:10 AM

We all know that the above are very good sports-type software for us, which can help users complete various sports in real time, and we can also see some of the above trajectories during some running processes. You can learn more about it. Many users don’t know about some of the above functional information, so today I will give you a good explanation of some of the content and experience, so that everyone can better carry out various functions. Some choices. If you also want to know some tracks and records about your own running, be sure not to miss it. More high-quality content is waiting for you to learn about it. A lot of interesting strategy information is waiting for you. If If you also want to know, let’s take a look with the editor now.​

See all articles