{"id":2127,"date":"2015-05-16T23:31:48","date_gmt":"2015-05-16T15:31:48","guid":{"rendered":"http:\/\/ixyzero.com\/blog\/?p=2127"},"modified":"2015-05-16T23:31:48","modified_gmt":"2015-05-16T15:31:48","slug":"mysql%e7%9a%84-frm-myi-myd-%e6%96%87%e4%bb%b6","status":"publish","type":"post","link":"https:\/\/ixyzero.com\/blog\/archives\/2127.html","title":{"rendered":"MySQL\u7684 .frm .myi .myd \u6587\u4ef6"},"content":{"rendered":"<h6>\u641c\u7d22\u5173\u952e\u5b57\uff1a<\/h6>\n<ul>\n<li>mysql .frm .myi .myd<\/li>\n<li>mysql .frm .myi .myd percona<\/li>\n<\/ul>\n<h6>\u53c2\u8003\u5185\u5bb9\uff1a<\/h6>\n<ul>\n<li>.frm \u4fdd\u5b58\u7684\u662f\u8868\u7684\u7ed3\u6784<\/li>\n<li>.MYD \u4fdd\u5b58\u7684\u662f\u8868\u7684\u6570\u636e\u8bb0\u5f55<\/li>\n<li>.MYI \u4fdd\u5b58\u7684\u662f\u8868\u7684\u7d22\u5f15<\/li>\n<\/ul>\n<p>=<\/p>\n<ul>\n<li>.FRM\u00a0 =&gt;\u00a0 It has the table structure of your table or table definition<\/li>\n<li>.MYI\u00a0 =&gt; \u00a0It has the indexes of your table<\/li>\n<li>.MYD \u00a0=&gt; \u00a0It contains your data<\/li>\n<\/ul>\n<p><span style=\"color: #0000ff;\"><strong>Engines Specific<\/strong><\/span>:<\/p>\n<p>Innodb:<\/p>\n<p>Innodb has only .frm files and it has its own tablespace where it contains indexes and datas and its shared in databases.<\/p>\n<p>MyISAM:<\/p>\n<p>MyIsam has all the three files. where .myi has your indexes, .myd has your table datas and .frm has its table definition.<\/p>\n<p>==<\/p>\n<p>A MySQL database creates a number of different data files in the mysql data directory (typically\/var\/lib\/mysql). The following are the differences between the data files created:<\/p>\n<table width=\"693\">\n<tbody>\n<tr>\n<td>File Extension<\/td>\n<td>Purpose<\/td>\n<\/tr>\n<tr>\n<td>.frm<\/td>\n<td>table definition<\/td>\n<\/tr>\n<tr>\n<td>.MYD<\/td>\n<td>table data<\/td>\n<\/tr>\n<tr>\n<td>.MYI<\/td>\n<td>table indices<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>I believe these files are created for both MyISAM and InnoDB table types because the MySQL documentation references these types with respect to MyISAM and I definitely see them on my InnoDB tables.<\/p>\n<p>==<\/p>\n<h6>\u53c2\u8003\u94fe\u63a5\uff1a<\/h6>\n<ul>\n<li><a href=\"http:\/\/stackoverflow.com\/questions\/879176\/how-to-recover-mysql-db-from-myd-myi-frm-files\" target=\"_blank\">http:\/\/stackoverflow.com\/questions\/879176\/how-to-recover-mysql-db-from-myd-myi-frm-files<\/a><\/li>\n<li><a href=\"http:\/\/www.mindfiresolutions.com\/Physical-Mysql--what-are-these-FRM-MYI-MYD-Need-this-1587.php\" target=\"_blank\">http:\/\/www.mindfiresolutions.com\/Physical-Mysql&#8211;what-are-these-FRM-MYI-MYD-Need-this-1587.php<\/a><\/li>\n<li><a href=\"http:\/\/dba.stackexchange.com\/questions\/30505\/why-does-mysql-produce-so-many-temporary-myd-files\" target=\"_blank\">http:\/\/dba.stackexchange.com\/questions\/30505\/why-does-mysql-produce-so-many-temporary-myd-files<\/a><\/li>\n<li>=<\/li>\n<li><a href=\"https:\/\/dev.mysql.com\/doc\/internals\/en\/frm-file-format.html\" target=\"_blank\">https:\/\/dev.mysql.com\/doc\/internals\/en\/frm-file-format.html<\/a><\/li>\n<li><a href=\"http:\/\/dev.mysql.com\/doc\/refman\/5.1\/en\/backup-methods.html\" target=\"_blank\">http:\/\/dev.mysql.com\/doc\/refman\/5.1\/en\/backup-methods.html<\/a><\/li>\n<li><a href=\"http:\/\/dev.mysql.com\/doc\/refman\/5.1\/en\/mysqldump.html\" target=\"_blank\">http:\/\/dev.mysql.com\/doc\/refman\/5.1\/en\/mysqldump.html<\/a><\/li>\n<li>=<\/li>\n<li><a href=\"http:\/\/blog.rootsmith.ca\/linux\/mysql-data-files-myd-myi-and-frm\/\" target=\"_blank\">http:\/\/blog.rootsmith.ca\/linux\/mysql-data-files-myd-myi-and-frm\/<\/a><\/li>\n<li>=<\/li>\n<li><a href=\"http:\/\/bytes.com\/topic\/mysql\/answers\/883099-how-restore-mysql-table-using-myd-myi-frm-files\" target=\"_blank\">http:\/\/bytes.com\/topic\/mysql\/answers\/883099-how-restore-mysql-table-using-myd-myi-frm-files<\/a><\/li>\n<li><a href=\"http:\/\/network.convergenceservices.in\/forum\/20-mysql\/1686-restore-a-mysql-database-from-frm-myd-and-myi-files.html\" target=\"_blank\">http:\/\/network.convergenceservices.in\/forum\/20-mysql\/1686-restore-a-mysql-database-from-frm-myd-and-myi-files.html<\/a><\/li>\n<li><a href=\"https:\/\/www.percona.com\/blog\/2008\/12\/17\/recovering-create-table-statement-from-frm-file\/\" target=\"_blank\">https:\/\/www.percona.com\/blog\/2008\/12\/17\/recovering-create-table-statement-from-frm-file\/<\/a><\/li>\n<li>=<\/li>\n<li><a href=\"http:\/\/blog.51yip.com\/mysql\/1005.html\" target=\"_blank\">\u901a\u8fc7\u62f7\u8d1dfrm myd myi opt\u6587\u4ef6\u6765\u5b9e\u73b0mysql\u7684\u5907\u4efd\u548c\u8fd8\u539f<\/a><\/li>\n<li><a href=\"http:\/\/database.51cto.com\/art\/201108\/281396.htm\" target=\"_blank\">http:\/\/database.51cto.com\/art\/201108\/281396.htm<\/a><\/li>\n<li>=<\/li>\n<li><a href=\"http:\/\/serverfault.com\/questions\/367255\/linux-mysql-is-it-safe-to-copy-mysql-db-files-with-cp-command-from-one-db-to\" target=\"_blank\">http:\/\/serverfault.com\/questions\/367255\/linux-mysql-is-it-safe-to-copy-mysql-db-files-with-cp-command-from-one-db-to<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>\u641c\u7d22\u5173\u952e\u5b57\uff1a mysql .frm .myi .myd mysql .frm .myi .myd percon [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[14,23],"tags":[509,16],"class_list":["post-2127","post","type-post","status-publish","format-standard","hentry","category-database","category-knowledgebase-2","tag-frm","tag-mysql"],"views":4387,"_links":{"self":[{"href":"https:\/\/ixyzero.com\/blog\/wp-json\/wp\/v2\/posts\/2127","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ixyzero.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ixyzero.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ixyzero.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/ixyzero.com\/blog\/wp-json\/wp\/v2\/comments?post=2127"}],"version-history":[{"count":0,"href":"https:\/\/ixyzero.com\/blog\/wp-json\/wp\/v2\/posts\/2127\/revisions"}],"wp:attachment":[{"href":"https:\/\/ixyzero.com\/blog\/wp-json\/wp\/v2\/media?parent=2127"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ixyzero.com\/blog\/wp-json\/wp\/v2\/categories?post=2127"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ixyzero.com\/blog\/wp-json\/wp\/v2\/tags?post=2127"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}