

{"id":51,"date":"2020-12-28T19:36:49","date_gmt":"2020-12-28T11:36:49","guid":{"rendered":"https:\/\/www.52dixiaowo.com\/database\/?p=51"},"modified":"2020-12-29T15:25:50","modified_gmt":"2020-12-29T07:25:50","slug":"mysql-%e6%95%b0%e6%8d%ae%e5%ba%93%e8%bf%81%e7%a7%bb","status":"publish","type":"post","link":"https:\/\/www.52dixiaowo.com\/db\/post-51.html","title":{"rendered":"mysql \u6570\u636e\u5e93\u8fc1\u79fb"},"content":{"rendered":"\n<h5>1.\u6ce8\u610f\u4e8b\u9879<\/h5>\n\n\n\n<p>\u5bfc\u5165\u5bfc\u51fa\u5148\u522b\u5220\u5e93\uff0c\u5bfc\u5b8c\u540e\u770b\u770b\u662f\u5426\u62a5\u9519\uff0cmysql \u7684\u8fc1\u79fb\u5f88\u5bb9\u6613\u62a5\u9519<\/p>\n\n\n\n<p>\u65b0\u65e7\u6570\u636e\u5e93\u8bbe\u7f6e\u76f8\u540c\u7684\u201c\u5b57\u7b26\u96c6\u201d<\/p>\n\n\n\n<h5>2.\u5bfc\u51fa\u65e7\u6570\u636e\u5e93<\/h5>\n\n\n\n<p>\u9996\u5148\uff0c\u4f60\u5e94\u8be5\u5148\u4f7f\u7528 cmd \u767b\u5f55 mysql \uff0c\u67e5\u770b\u8981\u5bfc\u51fa\u7684\u6570\u636e\u5e93\u7684\u7f16\u7801\u683c\u5f0f<\/p>\n\n\n\n<p>\uff08 address \u662f\u8fdc\u7a0b ip \u5730\u5740\uff0c\u6b64\u65f6\u624d\u9700\u8981 -h \uff0c\u672c\u673a\u4e0d\u8981\u52a0 -h\uff0c\u4e0d\u8981 localhost\uff09<\/p>\n\n\n\n<p>\uff08 -P \u662f\u7aef\u53e3\uff0c-u \u662f\u8d26\u53f7\uff0c-p \u662f\u5bc6\u7801\uff0c\u6ce8\u610f\u7a7a\u683c\u89c4\u8303\u5982\u4e0b\uff09<\/p>\n\n\n\n<p>\uff08\u9700\u8981\u914d\u7f6e Path \uff0c\u5426\u5219\u4f60\u9700\u8981\u5148\u8fdb\u5165mysql\u7684bin\u76ee\u5f55\u4e0b\u624d\u53ef\u6267\u884c\u8be5\u547d\u4ee4\uff09<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>mysql -h address -P 3306 -u root -p123456<\/code><\/pre>\n\n\n\n<p>\u6309\u7167\u524d\u9762\u7684\u65b9\u6cd5\uff0c\u67e5\u770b\u6570\u636e\u5e93 \u201c\u539f\u672c\u7684\u7f16\u7801\u683c\u5f0f\u201d \uff0c\u7b49\u4f1a\u6700\u597d\u4ee5\u8fd9\u4e2a\u7f16\u7801\u5bfc\u51fa<\/p>\n\n\n\n<p>\u63a5\u7740\uff0c\u4f7f\u7528 mysqldump \u5bfc\u51fa\u6570\u636e\u5e93\uff08\u4e5f\u9700\u8981\u914d\u7f6e path\uff0c\u8fd9\u91cc\u4e0d\u8d58\u8ff0\uff09<\/p>\n\n\n\n<p>\uff08\u5176\u4e2d\u7684 -h \u4e0e address \u662f\u8fdc\u7a0b\u5730\u5740\uff0c-P\u662f\u7aef\u53e3\uff0c-u \u4e0e -p \u662f\u5bc6\u94a5\uff09<\/p>\n\n\n\n<p>\uff08 &#8211;default-character-set \u662f\u5bfc\u51fa\u7684\u7f16\u7801\u683c\u5f0f\uff0cmytest\u6570\u636e\u5e93\u540d\uff0c\u540e\u5b58\u653e\u4f4d\u7f6e\uff09<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>mysqldump -haddress -P3306 -uroot -p123456 --default-character-set=utf8mb4 mytest &gt; D:\\MyDesk\\mytest.sql<\/code><\/pre>\n\n\n\n<p>\uff08\u547d\u4ee4\u884c\u5bfc\u51fa\uff0c\u770b\u4f3c\u6ca1\u95ee\u9898\uff0c\u4f46\u5bfc\u5165\u65f6\u62a5\u9519\u591a\uff0c\u63a8\u8350\u4f7f\u7528\u5de5\u5177\u5bfc\u51fa\uff0c\u5982 navicat\uff09<\/p>\n\n\n\n<p>\uff08navicat \u8fde\u63a5\u540e\uff0c\u9009\u4e2d\u5bf9\u5e94\u7684\u6570\u636e\u5e93\uff0c\u70b9\u51fb\u53f3\u952e\u5bfc\u51fa\u7ed3\u6784\u548c\u6570\u636e\uff0c\u4e5f\u5f88\u65b9\u4fbf\uff09<\/p>\n\n\n\n<p>\uff08navicat \u5bfc\u51fa\u540e\u7684\u6570\u636e\uff0c\u5bfc\u5165\u65f6\u62a5\u9519\u5c11\uff0c\u539f\u56e0\u81ea\u5df1\u731c\u3002\u3002\u3002\u3002\u3002\u3002\u3002\u3002\u3002\uff09<\/p>\n\n\n\n<h5>3.\u6570\u636e\u5bfc\u5165\u770b\u662f\u5426\u672c\u5730\u6570\u636e\u5e93\uff0c\u56e0\u4e3a\u4e91\u6570\u636e\u5e93\u9700\u8981\u5148\u8fdb\u884c\u8fdc\u7a0b\u8fde\u63a5<\/h5>\n\n\n\n<p>\u4f7f\u7528 cmd \u767b\u5f55 mysql \uff0c\u64cd\u4f5c\u548c\u524d\u9762\u4e00\u6837<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>mysql -h address -P 3306 -u root -p123456<\/code><\/pre>\n\n\n\n<p>\u8fd9\u6b21\u6211\u4eec\u4f7f\u7528 source \u547d\u4ee4\u5bfc\u5165\u6570\u636e\uff08\u53ef\u4ee5\u5b9e\u65f6\u89c2\u5bdf\u5bfc\u5165\u7ed3\u679c\uff09<\/p>\n\n\n\n<p>\u9996\u5148\u8bbe\u7f6e\u6570\u636e\u5e93\u7f16\u7801\uff08\u786e\u4fdd\u548c\u5bfc\u5165sql\u7f16\u7801\u4e00\u81f4\uff0c\u5047\u8bbe\u4e3a utf8mb4\uff09<\/p>\n\n\n\n<p>\uff08\u60a8\u5fc5\u987b\u5148\u8bbe\u7f6e\u7f16\u7801\uff0c\u518d\u521b\u5efa\u6570\u636e\u5e93\uff0c\u5426\u5219\u7f16\u7801\u4e0d\u751f\u6548\uff09<\/p>\n\n\n\n<p>\uff08\u6216\u8005\u5728\u521b\u5efa\u540e\uff0c\u4f7f\u7528 alter \u547d\u4ee4\u5f3a\u5236\u4fee\u6539\uff09<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>set names utf8mb4;\nset character_set_database = utf8mb4;\nset character_set_server = utf8mb4;<\/code><\/pre>\n\n\n\n<p>\u521b\u5efa\u4e00\u4e2a\u65b0\u7684\u6570\u636e\u5e93<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>create database mytest;<\/code><\/pre>\n\n\n\n<p>\u4f7f\u7528\u8be5\u6570\u636e\u5e93<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>use mytest;<\/code><\/pre>\n\n\n\n<p>\u4f7f\u7528 source \u547d\u4ee4\u5bfc\u5165\uff08\u8be5\u547d\u4ee4\u5728\u4e00\u4e9b\u8f6f\u4ef6\u4e2d\u4e0d\u53ef\u7528\uff0c\u8bf7\u5728 cmd \u6216\u7ec8\u7aef\u4f7f\u7528\uff09<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>source D:\\MyDesk\\mytest.sql;<\/code><\/pre>\n\n\n\n<p>\uff08 \u5373\u4f7f\u5c0f\u5fc3\u7ffc\u7ffc\uff0c\u5bfc\u5165\u53ef\u80fd\u8fd8\u662f\u4f1a\u6709\u9519\u8bef\uff0c\u5efa\u8bae\u4f7f\u7528 \u201c\u5bfc\u5165\u5de5\u5177\u201d \u5bfc\u5165\u6570\u636e\u5e93\uff09<\/p>\n\n\n\n<h5>4.\u4e3a\u4ec0\u4e48\u5bfc\u5165\u8fd8\u662f\u6709\u9519\u8bef\uff1f<\/h5>\n\n\n\n<p>\u4e00\u822c\u6765\u8bf4\uff0c\u6570\u636e\u5e93\u4e2d\u6709\u5f88\u591a\u8868\uff0c\u53ef\u80fd\u6ca1\u4e2a\u8868\u90fd\u7528\u4e86\u4e0d\u540c\u7684\u5b57\u7b26\u96c6\uff0c\u6574\u4e2a\u6570\u636e\u5e93\u8bbe\u7f6e\u7edf\u4e00\u7f16\u7801\u5bfc\u51fa\u5176\u5b9e\u662f\u6709\u95ee\u9898\u7684\uff0c\u4f60\u9700\u8981\u4ed4\u7ec6\u3001\u8c28\u614e\u7684\u8fdb\u884c\u6570\u636e\u8fc1\u79fb\u64cd\u4f5c\u3002<\/p>\n\n\n\n<p>\u5bfc\u5165\u7684\u6570\u636e\uff0c\u4e0e\u4f60\u5bfc\u51fa\u7684\u6570\u636e\u6709\u5f88\u5927\u7684\u5173\u7cfb\uff0c\u5bfc\u51fa\u4e0d\u6b63\u786e\uff0c\u5c31\u5f88\u5bb9\u6613\u5bfc\u4e0d\u8fdb\u53bb\u3002<\/p>\n\n\n\n<p>\u5bfc\u51fa\u65f6\uff0c\u63a8\u8350\u4f7f\u7528 navicat \u5de5\u5177\uff1b\u5bfc\u5165\u65f6\uff0c\u4f7f\u7528\u5b9d\u5854\u9762\u677f\u5bfc\u5165\uff0c\u51e0\u4e4e\u4e0d\u62a5\u9519\u3002<\/p>\n\n\n\n<h5>5.\u8fd8\u6709\u4ec0\u4e48\u66f4\u597d\u7684\u529e\u6cd5\uff1f<\/h5>\n\n\n\n<p>\u5b89\u88c5\u6570\u636e\u5e93\u65f6\uff0c\u9996\u8981\u5c31\u662f\u8bbe\u7f6e\u7f16\u7801<\/p>\n\n\n\n<p>\u5c3d\u91cf\u4e0d\u8fc1\u79fb\uff0c\u53ef\u4ee5\u4f7f\u7528\u4e91\u6570\u636e\u5e93\u7edf\u4e00\u7ba1\u7406\uff08\u5185\u7f51\u901f\u5ea6\u4e0d\u9519\uff0c\u5916\u7f51\u5c31\u7b97\u4e86\uff09<\/p>\n","protected":false},"excerpt":{"rendered":"<p>1.\u6ce8\u610f\u4e8b\u9879 \u5bfc\u5165\u5bfc\u51fa\u5148\u522b\u5220\u5e93\uff0c\u5bfc\u5b8c\u540e\u770b\u770b\u662f\u5426\u62a5\u9519\uff0cmysql \u7684\u8fc1\u79fb\u5f88\u5bb9\u6613\u62a5\u9519 \u65b0\u65e7\u6570\u636e\u5e93\u8bbe\u7f6e\u76f8\u540c\u7684\u201c\u5b57\u7b26\u96c6&hellip; <a href=\"https:\/\/www.52dixiaowo.com\/db\/post-51.html\" class=\"more-link\">\u7ee7\u7eed\u9605\u8bfb <span class=\"screen-reader-text\">mysql \u6570\u636e\u5e93\u8fc1\u79fb<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[4],"tags":[],"_links":{"self":[{"href":"https:\/\/www.52dixiaowo.com\/db\/wp-json\/wp\/v2\/posts\/51"}],"collection":[{"href":"https:\/\/www.52dixiaowo.com\/db\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.52dixiaowo.com\/db\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.52dixiaowo.com\/db\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.52dixiaowo.com\/db\/wp-json\/wp\/v2\/comments?post=51"}],"version-history":[{"count":3,"href":"https:\/\/www.52dixiaowo.com\/db\/wp-json\/wp\/v2\/posts\/51\/revisions"}],"predecessor-version":[{"id":74,"href":"https:\/\/www.52dixiaowo.com\/db\/wp-json\/wp\/v2\/posts\/51\/revisions\/74"}],"wp:attachment":[{"href":"https:\/\/www.52dixiaowo.com\/db\/wp-json\/wp\/v2\/media?parent=51"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.52dixiaowo.com\/db\/wp-json\/wp\/v2\/categories?post=51"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.52dixiaowo.com\/db\/wp-json\/wp\/v2\/tags?post=51"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}