{"id":6206,"date":"2024-11-14T12:51:39","date_gmt":"2024-11-14T04:51:39","guid":{"rendered":"https:\/\/fwq.ai\/blog\/6206\/"},"modified":"2024-11-14T12:51:39","modified_gmt":"2024-11-14T04:51:39","slug":"mysql%e6%95%b0%e6%8d%ae%e5%ba%93%e8%a2%ab%e5%88%a0%e9%99%a4%e5%a6%82%e4%bd%95%e6%81%a2%e5%a4%8d","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/6206\/","title":{"rendered":"mysql\u6570\u636e\u5e93\u88ab\u5220\u9664\u5982\u4f55\u6062\u590d"},"content":{"rendered":"<p><strong> \u6570\u636e\u5e93\u5220\u9664\u540e\u5982\u4f55\u6062\u590d<\/strong><\/p>\n<p><strong>\u5982\u4f55\u6062\u590d\u5df2\u5220\u9664\u7684 MySQL \u6570\u636e\u5e93\uff1f<\/strong><\/p>\n<p>\u5f53\u610f\u5916\u5220\u9664 MySQL \u6570\u636e\u5e93\u65f6\uff0c\u53ef\u4ee5\u91c7\u53d6\u4ee5\u4e0b\u6b65\u9aa4\u8fdb\u884c\u6062\u590d\uff1a<\/p>\n<p><strong>1. \u505c\u6b62 MySQL \u670d\u52a1<\/strong><\/p>\n<p>\u505c\u6b62 MySQL \u670d\u52a1\u4ee5\u9632\u6b62\u5bf9\u6570\u636e\u5e93\u8fdb\u884c\u4efb\u4f55\u8fdb\u4e00\u6b65\u7684\u66f4\u6539\u3002<\/p>\n<p><span>\u70b9\u51fb\u4e0b\u8f7d<\/span>\u201c\u201d\uff1b<\/p>\n<p><strong>2. \u627e\u5230\u6570\u636e\u5e93\u6587\u4ef6<\/strong><\/p>\n<p>\u6570\u636e\u5e93\u6587\u4ef6\u901a\u5e38\u5b58\u50a8\u5728 ibdata1 \u6587\u4ef6\u6216\u5355\u72ec\u7684\u6587\u4ef6\u4e2d\u3002\u5bf9\u4e8e InnoDB \u8868\uff0c\u6570\u636e\u5b58\u50a8\u5728 ibdata1 \u6587\u4ef6\u4e2d\u3002\u5bf9\u4e8e MyISAM \u8868\uff0c\u6570\u636e\u5b58\u50a8\u5728 .frm \u548c .MYD \u6587\u4ef6\u4e2d\u3002<\/p>\n<p>\u627e\u5230\u8fd9\u4e9b\u6587\u4ef6\u7684\u4f4d\u7f6e\uff0c\u901a\u5e38\u4f4d\u4e8e\u4ee5\u4e0b\u76ee\u5f55\u4e2d\uff1a<\/p>\n<ul>\n<li>Windows\uff1aC:Program FilesMySQLMySQL Server [version]data<\/li>\n<li>Linux\uff1a\/var\/lib\/mysql<\/li>\n<\/ul>\n<p><strong>3. \u590d\u5236\u6570\u636e\u5e93\u6587\u4ef6<\/strong><\/p>\n<p>\u5c06\u5df2\u5220\u9664\u7684\u6570\u636e\u5e93\u6587\u4ef6\u590d\u5236\u5230\u4e00\u4e2a\u5b89\u5168\u7684\u4f4d\u7f6e\uff0c\u4f8b\u5982\u5916\u90e8\u786c\u76d8\u9a71\u52a8\u5668\u6216\u4e91\u5b58\u50a8\u3002<\/p>\n<p><strong>4. \u521b\u5efa\u65b0\u6570\u636e\u5e93<\/strong><\/p>\n<p>\u4f7f\u7528\u76f8\u540c\u7684\u540d\u79f0\u91cd\u65b0\u521b\u5efa\u5df2\u5220\u9664\u7684\u6570\u636e\u5e93\u3002<\/p>\n<p><strong>5. \u5bfc\u5165\u6570\u636e<\/strong><\/p>\n<p>\u5c06\u6b65\u9aa4 3 \u4e2d\u590d\u5236\u7684\u6570\u636e\u5e93\u6587\u4ef6\u5bfc\u5165\u5230\u65b0\u521b\u5efa\u7684\u6570\u636e\u5e93\u4e2d\u3002\u5bf9\u4e8e InnoDB \u8868\uff0c\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n<pre>mysql -u [username] -p [password] [database_name] &lt; ibdata1<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u5bf9\u4e8e MyISAM \u8868\uff0c\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n<pre>mysql -u [username] -p [password] [database_name] &lt; [table_name].frm &lt; [table_name].MYD<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p><strong>6. \u68c0\u67e5\u6570\u636e<\/strong><\/p>\n<p>\u5bfc\u5165\u6570\u636e\u540e\uff0c\u68c0\u67e5\u662f\u5426\u6b63\u786e\u6062\u590d\u3002\u60a8\u53ef\u4ee5\u4f7f\u7528 SELECT * FROM [table_name]; \u547d\u4ee4\u67e5\u770b\u8868\u4e2d\u7684\u6570\u636e\u3002<\/p>\n<p><strong>\u6ce8\u610f\uff1a<\/strong><\/p>\n<ul>\n<li>\u6b64\u65b9\u6cd5\u4ec5\u9002\u7528\u4e8e\u5df2\u5b8c\u5168\u5220\u9664\u7684\u6570\u636e\u5e93\u3002\u5982\u679c\u6570\u636e\u5e93\u5df2\u635f\u574f\u6216\u90e8\u5206\u5220\u9664\uff0c\u5219\u53ef\u80fd\u9700\u8981\u4f7f\u7528\u66f4\u9ad8\u7ea7\u7684\u6062\u590d\u6280\u672f\u3002<\/li>\n<li>\u5b9a\u671f\u5907\u4efd\u6570\u636e\u5e93\u975e\u5e38\u91cd\u8981\uff0c\u4ee5\u9632\u4e07\u4e00\u51fa\u73b0\u7684\u60c5\u51b5\u3002<\/li>\n<\/ul>\n<p>\u4ee5\u4e0a\u5c31\u662f\u6570\u636e\u5e93\u88ab\u5220\u9664\u5982\u4f55\u6062\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>\u6570\u636e\u5e93\u5220\u9664\u540e\u5982\u4f55\u6062\u590d \u5982\u4f55\u6062\u590d\u5df2\u5220\u9664\u7684 MySQL \u6570\u636e\u5e93\uff1f \u5f53\u610f\u5916\u5220\u9664 MySQL \u6570\u636e\u5e93\u65f6\uff0c\u53ef\u4ee5\u91c7\u53d6\u4ee5\u4e0b\u6b65\u9aa4\u8fdb\u884c\u6062\u590d\uff1a 1. \u505c\u6b62 MySQL \u670d\u52a1 \u505c\u6b62 MySQL \u670d\u52a1\u4ee5\u9632\u6b62\u5bf9\u6570\u636e\u5e93\u8fdb\u884c\u4efb\u4f55\u8fdb\u4e00\u6b65\u7684\u66f4\u6539\u3002 \u70b9\u51fb\u4e0b\u8f7d\u201c\u201d\uff1b 2. \u627e\u5230\u6570\u636e\u5e93\u6587\u4ef6 \u6570\u636e\u5e93\u6587\u4ef6\u901a\u5e38\u5b58\u50a8\u5728 ibdata1 \u6587\u4ef6\u6216\u5355\u72ec\u7684\u6587\u4ef6\u4e2d\u3002\u5bf9\u4e8e InnoDB \u8868\uff0c\u6570\u636e\u5b58\u50a8\u5728 ibdata1 \u6587\u4ef6\u4e2d\u3002\u5bf9\u4e8e MyISAM \u8868\uff0c\u6570\u636e\u5b58\u50a8\u5728 .frm \u548c .MYD \u6587\u4ef6\u4e2d\u3002 \u627e\u5230\u8fd9\u4e9b\u6587\u4ef6\u7684\u4f4d\u7f6e\uff0c\u901a\u5e38\u4f4d\u4e8e\u4ee5\u4e0b\u76ee\u5f55\u4e2d\uff1a Windows\uff1aC:Program FilesMySQLMySQL Server [version]data Linux\uff1a\/var\/lib\/mysql 3. \u590d\u5236\u6570\u636e\u5e93\u6587\u4ef6 \u5c06\u5df2\u5220\u9664\u7684\u6570\u636e\u5e93\u6587\u4ef6\u590d\u5236\u5230\u4e00\u4e2a\u5b89\u5168\u7684\u4f4d\u7f6e\uff0c\u4f8b\u5982\u5916\u90e8\u786c\u76d8\u9a71\u52a8\u5668\u6216\u4e91\u5b58\u50a8\u3002 4. \u521b\u5efa\u65b0\u6570\u636e\u5e93 \u4f7f\u7528\u76f8\u540c\u7684\u540d\u79f0\u91cd\u65b0\u521b\u5efa\u5df2\u5220\u9664\u7684\u6570\u636e\u5e93\u3002 5. \u5bfc\u5165\u6570\u636e \u5c06\u6b65\u9aa4 3 \u4e2d\u590d\u5236\u7684\u6570\u636e\u5e93\u6587\u4ef6\u5bfc\u5165\u5230\u65b0\u521b\u5efa\u7684\u6570\u636e\u5e93\u4e2d\u3002\u5bf9\u4e8e InnoDB \u8868\uff0c\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\uff1a mysql -u [username] -p [password] [database_name] [&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-6206","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/6206","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=6206"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/6206\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=6206"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=6206"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=6206"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}