{"id":5150,"date":"2024-11-14T11:01:57","date_gmt":"2024-11-14T03:01:57","guid":{"rendered":"https:\/\/fwq.ai\/blog\/5150\/"},"modified":"2024-11-14T11:01:57","modified_gmt":"2024-11-14T03:01:57","slug":"mysql%e8%a1%a8%e6%8d%9f%e5%9d%8f%e6%80%8e%e4%b9%88%e4%bf%ae%e5%a4%8d","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/5150\/","title":{"rendered":"mysql\u8868\u635f\u574f\u600e\u4e48\u4fee\u590d"},"content":{"rendered":"<blockquote><p>\n  \u4fee\u590d mysql \u8868\u635f\u574f\uff1a1. \u4f7f\u7528 myisamchk \u5de5\u5177\uff08\u4ec5\u9002\u7528\u4e8e myisam \u8868\uff09\uff1b2. \u4f7f\u7528 repair table \u547d\u4ee4\uff08\u9002\u7528\u4e8e myisam \u548c innodb \u8868\uff09\uff1b3. \u91cd\u5efa\u8868\uff1b4. \u4f7f\u7528\u7b2c\u4e09\u65b9\u5de5\u5177\uff08\u5982 navicat premium \u6216 mysql workbench\uff09\u3002\u9884\u9632\u635f\u574f\u7684\u6700\u4f73\u5b9e\u8df5\uff1a\u5b9a\u671f\u5907\u4efd\u3001\u4f7f\u7528\u5408\u9002\u8868\u7c7b\u578b\u3001\u786e\u4fdd\u6570\u636e\u5e93\u548c mysql \u7248\u672c\u66f4\u65b0\u3001\u4f7f\u7528\u9002\u5f53\u6743\u9650\u548c\u9694\u79bb\u7ea7\u522b\uff0c\u4ee5\u53ca\u907f\u514d\u4e0d\u6b63\u786e\u8bed\u6cd5\u6216\u635f\u574f\u6570\u636e\u3002\n<\/p><\/blockquote>\n<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/202405\/22\/2024052217153060411.jpg\" class=\"aligncenter\" title=\"mysql\u8868\u635f\u574f\u600e\u4e48\u4fee\u590d\u63d2\u56fe\" alt=\"mysql\u8868\u635f\u574f\u600e\u4e48\u4fee\u590d\u63d2\u56fe\" \/><\/p>\n<p><strong>MySQL \u8868\u635f\u574f\u7684\u4fee\u590d<\/strong><\/p>\n<p><strong>\u5982\u4f55\u4fee\u590d\u635f\u574f\u7684 MySQL \u8868\uff1f<\/strong><\/p>\n<p>\u4fee\u590d\u635f\u574f\u7684 MySQL \u8868\u9700\u8981\u4f7f\u7528\u9002\u5f53\u7684\u6280\u672f\uff0c\u5177\u4f53\u53d6\u51b3\u4e8e\u635f\u574f\u7684\u4e25\u91cd\u7a0b\u5ea6\u548c\u7c7b\u578b\u3002\u8fd9\u91cc\u6709\u51e0\u79cd\u65b9\u6cd5\uff1a<\/p>\n<p><strong>1. \u4f7f\u7528 myisamchk \u5de5\u5177<\/strong><\/p>\n<p>\u5bf9\u4e8e MyISAM \u8868\uff0c\u53ef\u4ee5\u4f7f\u7528 myisamchk \u5de5\u5177\u3002\u6b64\u5de5\u5177\u53ef\u4ee5\u68c0\u67e5\u548c\u4fee\u590d\u5e38\u89c1\u7684\u8868\u635f\u574f\u95ee\u9898\u3002<\/p>\n<pre>myisamchk -r &lt;\u8868\u540d&gt;<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p><strong>2. \u4f7f\u7528 REPAIR TABLE \u547d\u4ee4<\/strong><\/p>\n<p>\u5bf9\u4e8e MyISAM \u548c InnoDB \u8868\uff0c\u53ef\u4ee5\u4f7f\u7528 REPAIR TABLE \u547d\u4ee4\u4fee\u590d\u635f\u574f\uff1a<\/p>\n<pre>REPAIR TABLE &lt;\u8868\u540d&gt;<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p><strong>3. \u91cd\u5efa\u8868<\/strong><\/p>\n<p>\u5982\u679c\u635f\u574f\u4e25\u91cd\uff0c\u5219\u53ef\u80fd\u9700\u8981\u91cd\u5efa\u8868\u3002\u4e3a\u6b64\uff0c\u8bf7\u8f6c\u50a8\u8868\u6570\u636e\uff0c\u5220\u9664\u8868\uff0c\u7136\u540e\u4ece\u8f6c\u50a8\u4e2d\u91cd\u65b0\u521b\u5efa\u5b83\u3002<\/p>\n<pre>mysqldump &lt;\u6570\u636e\u5e93\u540d&gt; &lt;\u8868\u540d&gt; &gt; dump.sql\nDROP TABLE &lt;\u8868\u540d&gt;;\nmysql &lt;\u6570\u636e\u5e93\u540d&gt; &lt; dump.sql<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p><strong>4. \u4f7f\u7528\u7b2c\u4e09\u65b9\u5de5\u5177<\/strong><\/p>\n<p>\u8fd8\u6709\u5176\u4ed6\u7b2c\u4e09\u65b9\u5de5\u5177\u53ef\u7528\u4e8e\u4fee\u590d\u635f\u574f\u7684 MySQL \u8868\uff0c\u4f8b\u5982 Navicat Premium \u6216 MySQL Workbench\u3002<\/p>\n<p><strong>\u9884\u9632 MySQL \u8868\u635f\u574f<\/strong><\/p>\n<p>\u4e3a\u4e86\u9632\u6b62 MySQL \u8868\u635f\u574f\uff0c\u8bf7\u9075\u5faa\u4ee5\u4e0b\u6700\u4f73\u5b9e\u8df5\uff1a<\/p>\n<ul>\n<li>\u5b9a\u671f\u5907\u4efd\u6570\u636e\u5e93<\/li>\n<li>\u4f7f\u7528\u9002\u5f53\u7684\u8868\u7c7b\u578b\uff08MyISAM \u6216 InnoDB\uff09<\/li>\n<li>\u786e\u4fdd\u6570\u636e\u5e93\u5f15\u64ce\u548c MySQL \u7248\u672c\u662f\u6700\u65b0\u7684<\/li>\n<li>\u4f7f\u7528\u9002\u5f53\u7684\u6743\u9650\u548c\u9694\u79bb\u7ea7\u522b<\/li>\n<li>\u907f\u514d\u4f7f\u7528\u4e0d\u6b63\u786e\u7684\u8bed\u6cd5\u6216\u635f\u574f\u7684\u6570\u636e<\/li>\n<\/ul>\n<p>\u4ee5\u4e0a\u5c31\u662f\u8868\u635f\u574f\u600e\u4e48\u4fee\u590d\u7684\u8be6\u7ec6\u5185\u5bb9\uff0c\u66f4\u591a\u8bf7\u5173\u6ce8\u7c73\u4e91\u7f51\u5176\u5b83\u76f8\u5173\u6587\u7ae0\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4fee\u590d mysql \u8868\u635f\u574f\uff1a1. \u4f7f\u7528 myisamchk \u5de5\u5177\uff08\u4ec5\u9002\u7528\u4e8e myisam \u8868\uff09\uff1b2. \u4f7f\u7528 repair table \u547d\u4ee4\uff08\u9002\u7528\u4e8e myisam \u548c innodb \u8868\uff09\uff1b3. \u91cd\u5efa\u8868\uff1b4. \u4f7f\u7528\u7b2c\u4e09\u65b9\u5de5\u5177\uff08\u5982 navicat premium \u6216 mysql workbench\uff09\u3002\u9884\u9632\u635f\u574f\u7684\u6700\u4f73\u5b9e\u8df5\uff1a\u5b9a\u671f\u5907\u4efd\u3001\u4f7f\u7528\u5408\u9002\u8868\u7c7b\u578b\u3001\u786e\u4fdd\u6570\u636e\u5e93\u548c mysql \u7248\u672c\u66f4\u65b0\u3001\u4f7f\u7528\u9002\u5f53\u6743\u9650\u548c\u9694\u79bb\u7ea7\u522b\uff0c\u4ee5\u53ca\u907f\u514d\u4e0d\u6b63\u786e\u8bed\u6cd5\u6216\u635f\u574f\u6570\u636e\u3002 MySQL \u8868\u635f\u574f\u7684\u4fee\u590d \u5982\u4f55\u4fee\u590d\u635f\u574f\u7684 MySQL \u8868\uff1f \u4fee\u590d\u635f\u574f\u7684 MySQL \u8868\u9700\u8981\u4f7f\u7528\u9002\u5f53\u7684\u6280\u672f\uff0c\u5177\u4f53\u53d6\u51b3\u4e8e\u635f\u574f\u7684\u4e25\u91cd\u7a0b\u5ea6\u548c\u7c7b\u578b\u3002\u8fd9\u91cc\u6709\u51e0\u79cd\u65b9\u6cd5\uff1a 1. \u4f7f\u7528 myisamchk \u5de5\u5177 \u5bf9\u4e8e MyISAM \u8868\uff0c\u53ef\u4ee5\u4f7f\u7528 myisamchk \u5de5\u5177\u3002\u6b64\u5de5\u5177\u53ef\u4ee5\u68c0\u67e5\u548c\u4fee\u590d\u5e38\u89c1\u7684\u8868\u635f\u574f\u95ee\u9898\u3002 myisamchk -r &lt;\u8868\u540d&gt; \u767b\u5f55\u540e\u590d\u5236 2. \u4f7f\u7528 REPAIR TABLE \u547d\u4ee4 \u5bf9\u4e8e MyISAM \u548c InnoDB [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16],"tags":[],"class_list":["post-5150","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/5150","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/comments?post=5150"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/5150\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=5150"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=5150"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=5150"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}