{"id":5493,"date":"2024-11-14T11:11:04","date_gmt":"2024-11-14T03:11:04","guid":{"rendered":"https:\/\/fwq.ai\/blog\/5493\/"},"modified":"2024-11-14T11:11:04","modified_gmt":"2024-11-14T03:11:04","slug":"mysql%e5%88%a0%e9%99%a4%e6%95%b0%e6%8d%ae%e6%80%8e%e4%b9%88%e6%81%a2%e5%a4%8d","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/5493\/","title":{"rendered":"mysql\u5220\u9664\u6570\u636e\u600e\u4e48\u6062\u590d"},"content":{"rendered":"<blockquote><p>\n  \u5df2\u5220\u9664\u7684 mysql \u6570\u636e\u53ef\u4ee5\u901a\u8fc7\u4e09\u79cd\u65b9\u6cd5\u6062\u590d\uff1a\u4ece\u5907\u4efd\u6062\u590d\u3001\u4f7f\u7528 mysql \u4e8c\u8fdb\u5236\u65e5\u5fd7\u6216\u4f7f\u7528\u78c1\u76d8\u6062\u590d\u5de5\u5177\uff0c\u9700\u6ce8\u610f\u6570\u636e\u672a\u88ab\u8986\u76d6\uff0c\u5728\u64cd\u4f5c\u524d\u5907\u4efd\u6570\u636e\u5e93\u3002\n<\/p><\/blockquote>\n<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/202405\/29\/2024052904242454201.jpg\" class=\"aligncenter\" title=\"mysql\u5220\u9664\u6570\u636e\u600e\u4e48\u6062\u590d\u63d2\u56fe\" alt=\"mysql\u5220\u9664\u6570\u636e\u600e\u4e48\u6062\u590d\u63d2\u56fe\" \/><\/p>\n<p><strong>MySQL \u6570\u636e\u6062\u590d\uff1a\u5220\u9664\u6570\u636e\u7684\u8865\u6551\u63aa\u65bd<\/strong><\/p>\n<p><strong>\u5982\u4f55\u6062\u590d\u5df2\u5220\u9664\u7684 MySQL \u6570\u636e\uff1f<\/strong><\/p>\n<p>\u5df2\u5220\u9664\u7684 MySQL \u6570\u636e\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u65b9\u6cd5\u6062\u590d\uff1a<\/p>\n<p><strong>1. \u4ece\u5907\u4efd\u6062\u590d<\/strong><\/p>\n<p><span>\u70b9\u51fb\u4e0b\u8f7d<\/span>\u201c\u201d\uff1b<\/p>\n<ul>\n<li>\u786e\u4fdd\u5728\u4e4b\u524d\u6709\u5907\u4efd\u3002<\/li>\n<li>\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u4ece\u5907\u4efd\u6062\u590d\u6570\u636e\u5e93\uff1a<\/li>\n<\/ul>\n<pre>mysql -u root -p\nuse &lt;database_name&gt;;\nsource &lt;backup_file.sql&gt;;<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p><strong>2. \u4f7f\u7528 MySQL \u4e8c\u8fdb\u5236\u65e5\u5fd7<\/strong><\/p>\n<ul>\n<li>\u4e8c\u8fdb\u5236\u65e5\u5fd7\u8bb0\u5f55\u4e86\u6240\u6709\u5bf9\u6570\u636e\u5e93\u6240\u505a\u7684\u66f4\u6539\uff0c\u5305\u62ec\u5220\u9664\u3002<\/li>\n<li>\u5982\u679c\u542f\u7528\u4e86\u4e8c\u8fdb\u5236\u65e5\u5fd7\u8bb0\u5f55\uff0c\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u65b9\u6cd5\u6062\u590d\u6570\u636e\uff1a<\/li>\n<li>\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u505c\u6b62 MySQL \u670d\u52a1\u5668\uff1a<\/li>\n<\/ul>\n<pre>systemctl stop mysql<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<ul>\n<li>\u5c06\u4e8c\u8fdb\u5236\u65e5\u5fd7\u6587\u4ef6\u91cd\u547d\u540d\u4e3a\u5177\u6709 .ibd \u6269\u5c55\u540d\u7684\u8868\u6587\u4ef6\uff1a<\/li>\n<\/ul>\n<pre>mv \/var\/lib\/mysql\/&lt;database_name&gt;\/&lt;table_name&gt;.bin \/var\/lib\/mysql\/&lt;database_name&gt;\/&lt;table_name&gt;.ibd<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<ul>\n<li>\u91cd\u65b0\u542f\u52a8 MySQL \u670d\u52a1\u5668\uff1a<\/li>\n<\/ul>\n<pre>systemctl start mysql<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p><strong>3. \u4f7f\u7528\u78c1\u76d8\u6062\u590d\u5de5\u5177<\/strong><\/p>\n<ul>\n<li>\u5982\u679c\u4e0a\u8ff0\u65b9\u6cd5\u5931\u8d25\uff0c\u53ef\u4ee5\u4f7f\u7528\u78c1\u76d8\u6062\u590d\u5de5\u5177\uff08\u4f8b\u5982 Recuva\uff09\u6062\u590d\u5df2\u5220\u9664\u7684\u6587\u4ef6\u3002<\/li>\n<li>\u5c3d\u7ba1\u6b64\u65b9\u6cd5\u4e0d\u4fdd\u8bc1\u6062\u590d\u6240\u6709\u6570\u636e\uff0c\u4f46\u503c\u5f97\u4e00\u8bd5\u3002<\/li>\n<\/ul>\n<p><strong>\u6ce8\u610f\u4e8b\u9879\uff1a<\/strong><\/p>\n<ul>\n<li>\u786e\u4fdd\u5df2\u5220\u9664\u7684\u6570\u636e\u672a\u88ab\u8986\u76d6\u3002<\/li>\n<li>\u5728\u5c1d\u8bd5\u6062\u590d\u6570\u636e\u4e4b\u524d\uff0c\u5907\u4efd\u6570\u636e\u5e93\u4ee5\u9632\u6b62\u8fdb\u4e00\u6b65\u7684\u6570\u636e\u4e22\u5931\u3002<\/li>\n<li>\u5982\u679c\u65e0\u6cd5\u6062\u590d\u6570\u636e\uff0c\u8bf7\u54a8\u8be2\u6570\u636e\u5e93\u7ba1\u7406\u4e13\u4e1a\u4eba\u5458\u5c0b\u6c42\u5354\u52a9\u3002<\/li>\n<\/ul>\n<p>\u4ee5\u4e0a\u5c31\u662f\u5220\u9664\u6570\u636e\u600e\u4e48\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>\u5df2\u5220\u9664\u7684 mysql \u6570\u636e\u53ef\u4ee5\u901a\u8fc7\u4e09\u79cd\u65b9\u6cd5\u6062\u590d\uff1a\u4ece\u5907\u4efd\u6062\u590d\u3001\u4f7f\u7528 mysql \u4e8c\u8fdb\u5236\u65e5\u5fd7\u6216\u4f7f\u7528\u78c1\u76d8\u6062\u590d\u5de5\u5177\uff0c\u9700\u6ce8\u610f\u6570\u636e\u672a\u88ab\u8986\u76d6\uff0c\u5728\u64cd\u4f5c\u524d\u5907\u4efd\u6570\u636e\u5e93\u3002 MySQL \u6570\u636e\u6062\u590d\uff1a\u5220\u9664\u6570\u636e\u7684\u8865\u6551\u63aa\u65bd \u5982\u4f55\u6062\u590d\u5df2\u5220\u9664\u7684 MySQL \u6570\u636e\uff1f \u5df2\u5220\u9664\u7684 MySQL \u6570\u636e\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u65b9\u6cd5\u6062\u590d\uff1a 1. \u4ece\u5907\u4efd\u6062\u590d \u70b9\u51fb\u4e0b\u8f7d\u201c\u201d\uff1b \u786e\u4fdd\u5728\u4e4b\u524d\u6709\u5907\u4efd\u3002 \u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u4ece\u5907\u4efd\u6062\u590d\u6570\u636e\u5e93\uff1a mysql -u root -p use &lt;database_name&gt;; source &lt;backup_file.sql&gt;; \u767b\u5f55\u540e\u590d\u5236 2. \u4f7f\u7528 MySQL \u4e8c\u8fdb\u5236\u65e5\u5fd7 \u4e8c\u8fdb\u5236\u65e5\u5fd7\u8bb0\u5f55\u4e86\u6240\u6709\u5bf9\u6570\u636e\u5e93\u6240\u505a\u7684\u66f4\u6539\uff0c\u5305\u62ec\u5220\u9664\u3002 \u5982\u679c\u542f\u7528\u4e86\u4e8c\u8fdb\u5236\u65e5\u5fd7\u8bb0\u5f55\uff0c\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u65b9\u6cd5\u6062\u590d\u6570\u636e\uff1a \u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u505c\u6b62 MySQL \u670d\u52a1\u5668\uff1a systemctl stop mysql \u767b\u5f55\u540e\u590d\u5236 \u5c06\u4e8c\u8fdb\u5236\u65e5\u5fd7\u6587\u4ef6\u91cd\u547d\u540d\u4e3a\u5177\u6709 .ibd \u6269\u5c55\u540d\u7684\u8868\u6587\u4ef6\uff1a mv \/var\/lib\/mysql\/&lt;database_name&gt;\/&lt;table_name&gt;.bin \/var\/lib\/mysql\/&lt;database_name&gt;\/&lt;table_name&gt;.ibd \u767b\u5f55\u540e\u590d\u5236 \u91cd\u65b0\u542f\u52a8 MySQL \u670d\u52a1\u5668\uff1a systemctl start mysql \u767b\u5f55\u540e\u590d\u5236 3. [&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-5493","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/5493","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=5493"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/5493\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=5493"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=5493"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=5493"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}