{"id":3125,"date":"2014-10-12T18:06:35","date_gmt":"2014-10-12T10:06:35","guid":{"rendered":"https:\/\/sdeno.com\/?p=3125"},"modified":"2014-10-12T18:06:35","modified_gmt":"2014-10-12T10:06:35","slug":"mysql%e5%91%bd%e4%bb%a4%e5%a4%87%e4%bb%bd%e6%95%b0%e6%8d%ae%e5%ba%93","status":"publish","type":"post","link":"https:\/\/sdeno.com\/?p=3125","title":{"rendered":"mysql\u547d\u4ee4\u5907\u4efd\u6570\u636e\u5e93"},"content":{"rendered":"<p style=\"color: #555555;\"><strong>MySQL\u6570\u636e\u5e93\u4f7f\u7528\u547d\u4ee4\u884c\u5907\u4efd<\/strong>|<strong>MySQL\u6570\u636e\u5e93\u5907\u4efd\u547d\u4ee4<\/strong><\/p>\n<p style=\"color: #555555;\">\u4f8b\u5982\uff1a<\/p>\n<p style=\"color: #555555;\">\u6570\u636e\u5e93\u5730\u5740\uff1a127.0.0.1<\/p>\n<p style=\"color: #555555;\">\u6570\u636e\u5e93\u7528\u6237\u540d\uff1aroot<\/p>\n<p style=\"color: #555555;\">\u6570\u636e\u5e93\u5bc6\u7801\uff1apass<\/p>\n<p style=\"color: #555555;\">\u6570\u636e\u5e93\u540d\u79f0\uff1amyweb<\/p>\n<div class=\"cnblogs_code\" style=\"color: #000000;\">\n<pre><span style=\"color: #000000;\">\u5907\u4efd\u6570\u636e\u5e93\u5230D\u76d8\u8ddf\u76ee\u5f55\r\n\r\nmysqldump <\/span><span style=\"color: #808080;\">-<\/span>h127.<span style=\"font-weight: bold; color: #800000;\">0.0<\/span>.<span style=\"font-weight: bold; color: #800000;\">1<\/span> <span style=\"color: #808080;\">-<\/span>uroot <span style=\"color: #808080;\">-<\/span>ppass myweb <span style=\"color: #808080;\">&gt;<\/span> d:<span style=\"color: #808080;\">\/<\/span>backupfile.sql<\/pre>\n<\/div>\n<div class=\"cnblogs_code\" style=\"color: #000000;\">\n<pre><span style=\"color: #000000;\">\u5907\u4efd\u5230\u5f53\u524d\u76ee\u5f55 \u5907\u4efdMySQL\u6570\u636e\u5e93\u4e3a\u5e26\u5220\u9664\u8868\u7684\u683c\u5f0f\uff0c\u80fd\u591f\u8ba9\u8be5\u5907\u4efd\u8986\u76d6\u5df2\u6709\u6570\u636e\u5e93\u800c\u4e0d\u9700\u8981\u624b\u52a8\u5220\u9664\u539f\u6709\u6570\u636e\u5e93\r\n\r\nmysqldump <\/span><span style=\"color: #008080;\">--<\/span><span style=\"color: #008080;\">add-drop-table -h127.0.0.1 -uroot -ppass myweb &gt; backupfile.sql<\/span><\/pre>\n<\/div>\n<div class=\"cnblogs_code\" style=\"color: #000000;\">\n<pre><span style=\"color: #000000;\">\u76f4\u63a5\u5c06MySQL\u6570\u636e\u5e93\u538b\u7f29\u5907\u4efd  \u5907\u4efd\u5230D\u76d8\u8ddf\u76ee\u5f55\r\n\r\nmysqldump <\/span><span style=\"color: #808080;\">-<\/span>h127.<span style=\"font-weight: bold; color: #800000;\">0.0<\/span>.<span style=\"font-weight: bold; color: #800000;\">1<\/span> <span style=\"color: #808080;\">-<\/span>uroot <span style=\"color: #808080;\">-<\/span>ppass myweb <span style=\"color: #808080;\">|<\/span> gzip <span style=\"color: #808080;\">&gt;<\/span> d:<span style=\"color: #808080;\">\/<\/span>backupfile.sql.gz<\/pre>\n<\/div>\n<div class=\"cnblogs_code\" style=\"color: #000000;\">\n<pre>\u5907\u4efdMySQL\u6570\u636e\u5e93\u67d0\u4e2a(\u4e9b)\u8868\u3002\u6b64\u4f8b\u5907\u4efdtable1\u8868\u548ctable2\u8868\u3002\u5907\u4efd\u5230linux\u4e3b\u673a\u7684<span style=\"color: #808080;\">\/<\/span><span style=\"color: #000000;\">home\u4e0b\r\nmysqldump <\/span><span style=\"color: #808080;\">-<\/span>h127.<span style=\"font-weight: bold; color: #800000;\">0.0<\/span>.<span style=\"font-weight: bold; color: #800000;\">1<\/span> <span style=\"color: #808080;\">-<\/span>uroot <span style=\"color: #808080;\">-<\/span>ppass myweb table1 table2 <span style=\"color: #808080;\">&gt;<\/span> <span style=\"color: #808080;\">\/<\/span>home<span style=\"color: #808080;\">\/<\/span>backupfile.sql<\/pre>\n<\/div>\n<div class=\"cnblogs_code\" style=\"color: #000000;\">\n<pre><span style=\"color: #000000;\">\u540c\u65f6\u5907\u4efd\u591a\u4e2aMySQL\u6570\u636e\u5e93\r\n\r\nmysqldump <\/span><span style=\"color: #808080;\">-<\/span>h127.<span style=\"font-weight: bold; color: #800000;\">0.0<\/span>.<span style=\"font-weight: bold; color: #800000;\">1<\/span> <span style=\"color: #808080;\">-<\/span>uroot <span style=\"color: #808080;\">-<\/span>ppass <span style=\"color: #008080;\">--<\/span><span style=\"color: #008080;\">databases myweb myweb2 &gt; multibackupfile.sql<\/span><\/pre>\n<\/div>\n<div class=\"cnblogs_code\" style=\"color: #000000;\">\n<pre><span style=\"color: #000000;\">\u4ec5\u4ec5\u5907\u4efd\u6570\u636e\u5e93\u7ed3\u6784\u3002\u540c\u65f6\u5907\u4efd\u540d\u4e3amyweb\u6570\u636e\u5e93\u548c\u540d\u4e3amyweb2\u6570\u636e\u5e93\r\n\r\nmysqldump <\/span><span style=\"color: #008080;\">--<\/span><span style=\"color: #008080;\">no-data -h127.0.0.1 -uroot -ppass --databases myweb myweb2 &gt; structurebackupfile.sql<\/span><\/pre>\n<\/div>\n<div class=\"cnblogs_code\" style=\"color: #000000;\">\n<pre><span style=\"color: #000000;\">\u5907\u4efd\u670d\u52a1\u5668\u4e0a\u6240\u6709\u6570\u636e\u5e93\r\n\r\nmysqldump <\/span><span style=\"color: #008080;\">--<\/span><span style=\"color: #008080;\">all-databases -h127.0.0.1 -uroot -ppass &gt; allbackupfile.sql<\/span><\/pre>\n<\/div>\n<div class=\"cnblogs_code\" style=\"color: #000000;\">\n<pre><span style=\"color: #000000;\">\u8fd8\u539fMySQL\u6570\u636e\u5e93\u7684\u547d\u4ee4\u3002\u8fd8\u539f\u5f53\u524d\u5907\u4efd\u540d\u4e3abackupfile.sql\u7684\u6570\u636e\u5e93\r\n\r\nmysql <\/span><span style=\"color: #808080;\">-<\/span>h127.<span style=\"font-weight: bold; color: #800000;\">0.0<\/span>.<span style=\"font-weight: bold; color: #800000;\">1<\/span> <span style=\"color: #808080;\">-<\/span>uroot <span style=\"color: #808080;\">-<\/span>ppass myweb <span style=\"color: #808080;\">&lt;<\/span> backupfile.sql<\/pre>\n<\/div>\n<div class=\"cnblogs_code\" style=\"color: #000000;\">\n<pre><span style=\"color: #000000;\">\u8fd8\u539f\u538b\u7f29\u7684MySQL\u6570\u636e\u5e93\r\n\r\ngunzip <\/span><span style=\"color: #808080;\">&lt;<\/span> backupfile.sql.gz <span style=\"color: #808080;\">|<\/span> mysql <span style=\"color: #808080;\">-<\/span>h127.<span style=\"font-weight: bold; color: #800000;\">0.0<\/span>.<span style=\"font-weight: bold; color: #800000;\">1<\/span> <span style=\"color: #808080;\">-<\/span>uroot <span style=\"color: #808080;\">-<\/span>ppass myweb<\/pre>\n<\/div>\n<div class=\"cnblogs_code\" style=\"color: #000000;\">\n<pre><span style=\"color: #000000;\">\u5c06\u6570\u636e\u5e93\u8f6c\u79fb\u5230\u65b0\u670d\u52a1\u5668\u3002\u6b64\u4f8b\u4e3a\u5c06\u672c\u5730\u6570\u636e\u5e93myweb\u590d\u5236\u5230\u8fdc\u7a0b\u6570\u636e\u5e93\u540d\u4e3aserweb\u4e2d\uff0c\u5176\u4e2d\u8fdc\u7a0b\u6570\u636e\u5e93\u5fc5\u987b\u6709\u540d\u4e3aserweb\u7684\u6570\u636e\u5e93\r\n\r\nmysqldump <\/span><span style=\"color: #808080;\">-<\/span>h127.<span style=\"font-weight: bold; color: #800000;\">0.0<\/span>.<span style=\"font-weight: bold; color: #800000;\">1<\/span> <span style=\"color: #808080;\">-<\/span>uroot <span style=\"color: #808080;\">-<\/span>ppass myweb <span style=\"color: #808080;\">|<\/span> mysql <span style=\"color: #008080;\">--<\/span><span style=\"color: #008080;\">host=***.***.***.*** -u\u6570\u636e\u5e93\u7528\u6237\u540d -p\u6570\u636e\u5e93\u5bc6\u7801 -C serweb<\/span><\/pre>\n<\/div>\n<p style=\"color: #555555;\">\u00a0<a href=\"https:\/\/sdeno.com\/wp-content\/uploads\/2014\/10\/mysql_bak.txt\">mysql_bak<\/a><\/p>\n<p><a href=\"http:\/\/www.cnblogs.com\/xcxc\/archive\/2013\/01\/30\/2882840.html\" target=\"_blank\">http:\/\/www.cnblogs.com\/xcxc\/archive\/2013\/01\/30\/2882840.html<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>MySQL\u6570\u636e\u5e93\u4f7f\u7528\u547d\u4ee4\u884c\u5907\u4efd|MySQL\u6570\u636e\u5e93\u5907\u4efd\u547d\u4ee4 \u4f8b\u5982\uff1a \u6570\u636e\u5e93\u5730\u5740\uff1a127.0.0.1 \u6570\u636e\u5e93\u7528\u6237\u540d [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9],"tags":[],"class_list":["post-3125","post","type-post","status-publish","format-standard","hentry","category-9"],"_links":{"self":[{"href":"https:\/\/sdeno.com\/index.php?rest_route=\/wp\/v2\/posts\/3125","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/sdeno.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/sdeno.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/sdeno.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/sdeno.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3125"}],"version-history":[{"count":0,"href":"https:\/\/sdeno.com\/index.php?rest_route=\/wp\/v2\/posts\/3125\/revisions"}],"wp:attachment":[{"href":"https:\/\/sdeno.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3125"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sdeno.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3125"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sdeno.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3125"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}