{"id":7601,"date":"2024-11-14T12:38:31","date_gmt":"2024-11-14T04:38:31","guid":{"rendered":"https:\/\/fwq.ai\/blog\/7601\/"},"modified":"2024-11-14T12:38:31","modified_gmt":"2024-11-14T04:38:31","slug":"%e5%a6%82%e4%bd%95%e4%bd%bf%e7%94%a8-navicat-%e7%94%9f%e6%88%90%e5%88%9b%e5%bb%ba%e6%95%b0%e6%8d%ae%e5%ba%93%e7%9a%84-sql-%e8%af%ad%e5%8f%a5%ef%bc%9f","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/7601\/","title":{"rendered":"\u5982\u4f55\u4f7f\u7528 Navicat \u751f\u6210\u521b\u5efa\u6570\u636e\u5e93\u7684 SQL \u8bed\u53e5\uff1f"},"content":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/001\/246\/273\/173104922370081.jpg\" class=\"aligncenter\" title=\"\u5982\u4f55\u4f7f\u7528 Navicat \u751f\u6210\u521b\u5efa\u6570\u636e\u5e93\u7684 SQL \u8bed\u53e5\uff1f\u63d2\u56fe\" alt=\"\u5982\u4f55\u4f7f\u7528 Navicat \u751f\u6210\u521b\u5efa\u6570\u636e\u5e93\u7684 SQL \u8bed\u53e5\uff1f\u63d2\u56fe\" \/><\/p>\n<p><strong>\u5982\u4f55\u5728  \u4e2d\u751f\u6210\u521b\u5efa\u6570\u636e\u5e93\u7684 sql \u8bed\u53e5\uff1f<\/strong><\/p>\n<p>\u5728 navicat \u4e2d\uff0c\u4f7f\u7528\u201c\u8f6c\u50a8 sql \u6587\u4ef6\u201d\u529f\u80fd\u53ea\u80fd\u5907\u4efd\u8868\u548c\u6570\u636e\uff0c\u65e0\u6cd5\u751f\u6210\u521b\u5efa\u6570\u636e\u5e93\u7684 sql \u8bed\u53e5\u3002\u8fd9\u7ed9\u8fd8\u539f\u6570\u636e\u5e93\u548c\u7ba1\u7406\u6570\u636e\u5e93\u540d\u79f0\u5e26\u6765\u4e86\u4e0d\u4fbf\u3002<\/p>\n<p><strong>\u89e3\u51b3\u529e\u6cd5\uff1a<\/strong><\/p>\n<p>\u53ef\u4ee5\u4f7f\u7528\u547d\u4ee4\u884c\u5de5\u5177 dump \u6765\u89e3\u51b3\u6b64\u95ee\u9898\u3002\u8be5\u5de5\u5177\u63d0\u4f9b\u4e86\u4e00\u4e2a -b \u53c2\u6570\uff0c\u53ef\u4ee5\u751f\u6210\u521b\u5efa\u6570\u636e\u5e93\u8bed\u53e5\u3002<\/p>\n<p><strong>\u7528\u6cd5\uff1a<\/strong><\/p>\n<pre>mysqldump -utest -p -b test &gt; test.sql<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u5176\u4e2d\uff1a<\/p>\n<ul>\n<li>-u: mysql \u7528\u6237\u540d<\/li>\n<li>-p: mysql \u5bc6\u7801<\/li>\n<li>test: \u8981\u5907\u4efd\u7684\u6570\u636e\u5e93\u540d\u79f0<\/li>\n<li>test.sql: \u751f\u6210\u7684 sql \u6587\u4ef6\u540d\u79f0<\/li>\n<\/ul>\n<p><strong>\u751f\u6210\u7684\u5185\u5bb9\uff1a<\/strong><\/p>\n<p>mysqldump \u4f7f\u7528 -b \u53c2\u6570\u751f\u6210\u7684 sql \u6587\u4ef6\u5305\u542b\u4ee5\u4e0b\u5185\u5bb9\uff1a<\/p>\n<pre>CREATE DATABASE \/*!32312 IF NOT EXISTS*\/ `test` \/*!40100 DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci *\/ \/*!80016 DEFAULT ENCRYPTION='N' *\/;\n\nUSE `test`;<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<ul>\n<li>\u7b2c\u4e00\u884c\u521b\u5efa\u6570\u636e\u5e93\u5e76\u6307\u5b9a\u5b57\u7b26\u96c6\u548c\u6392\u5e8f\u89c4\u5219\u3002<\/li>\n<li>\u7b2c\u4e8c\u884c\u5c06 mysql \u8fde\u63a5\u5207\u6362\u5230\u521a\u521a\u521b\u5efa\u7684\u6570\u636e\u5e93\u3002<\/li>\n<\/ul>\n<p>\u901a\u8fc7\u4f7f\u7528 mysqldump \u548c -b \u53c2\u6570\uff0c\u53ef\u4ee5\u8f7b\u677e\u5730\u5c06\u6574\u4e2a mysql \u6570\u636e\u5e93\u5907\u4efd\u51fa\u6765\uff0c\u5305\u62ec\u521b\u5efa\u6570\u636e\u5e93\u7684 sql \u8bed\u53e5\u3002<\/p>\n<p>\u4ee5\u4e0a\u5c31\u662f\u5982\u4f55\u4f7f\u7528 Navicat \u751f\u6210\u521b\u5efa\u6570\u636e\u5e93\u7684 SQL \u8bed\u53e5\uff1f\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>\u5982\u4f55\u5728 \u4e2d\u751f\u6210\u521b\u5efa\u6570\u636e\u5e93\u7684 sql \u8bed\u53e5\uff1f \u5728 navicat \u4e2d\uff0c\u4f7f\u7528\u201c\u8f6c\u50a8 sql \u6587\u4ef6\u201d\u529f\u80fd\u53ea\u80fd\u5907\u4efd\u8868\u548c\u6570\u636e\uff0c\u65e0\u6cd5\u751f\u6210\u521b\u5efa\u6570\u636e\u5e93\u7684 sql \u8bed\u53e5\u3002\u8fd9\u7ed9\u8fd8\u539f\u6570\u636e\u5e93\u548c\u7ba1\u7406\u6570\u636e\u5e93\u540d\u79f0\u5e26\u6765\u4e86\u4e0d\u4fbf\u3002 \u89e3\u51b3\u529e\u6cd5\uff1a \u53ef\u4ee5\u4f7f\u7528\u547d\u4ee4\u884c\u5de5\u5177 dump \u6765\u89e3\u51b3\u6b64\u95ee\u9898\u3002\u8be5\u5de5\u5177\u63d0\u4f9b\u4e86\u4e00\u4e2a -b \u53c2\u6570\uff0c\u53ef\u4ee5\u751f\u6210\u521b\u5efa\u6570\u636e\u5e93\u8bed\u53e5\u3002 \u7528\u6cd5\uff1a mysqldump -utest -p -b test &gt; test.sql \u767b\u5f55\u540e\u590d\u5236 \u5176\u4e2d\uff1a -u: mysql \u7528\u6237\u540d -p: mysql \u5bc6\u7801 test: \u8981\u5907\u4efd\u7684\u6570\u636e\u5e93\u540d\u79f0 test.sql: \u751f\u6210\u7684 sql \u6587\u4ef6\u540d\u79f0 \u751f\u6210\u7684\u5185\u5bb9\uff1a mysqldump \u4f7f\u7528 -b \u53c2\u6570\u751f\u6210\u7684 sql \u6587\u4ef6\u5305\u542b\u4ee5\u4e0b\u5185\u5bb9\uff1a CREATE DATABASE \/*!32312 IF NOT EXISTS*\/ `test` \/*!40100 DEFAULT [&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-7601","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/7601","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=7601"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/7601\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=7601"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=7601"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=7601"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}