{"id":6676,"date":"2024-11-14T10:33:48","date_gmt":"2024-11-14T02:33:48","guid":{"rendered":"https:\/\/fwq.ai\/blog\/6676\/"},"modified":"2024-11-14T10:33:48","modified_gmt":"2024-11-14T02:33:48","slug":"mysql%e5%ae%89%e8%a3%85%e4%bd%bf%e7%94%a8%e6%95%99%e7%a8%8b-%e7%bb%bf%e8%89%b2%e7%89%88%e7%9a%84mysql%e5%ae%89%e8%a3%85%e6%95%99%e7%a8%8b","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/6676\/","title":{"rendered":"mysql\u5b89\u88c5\u4f7f\u7528\u6559\u7a0b \u7eff\u8272\u7248\u7684mysql\u5b89\u88c5\u6559\u7a0b"},"content":{"rendered":"<blockquote><p>\n  \u672c\u6559\u7a0b\u5c06\u8be6\u7ec6\u4ecb\u7ecd\u5982\u4f55\u5b89\u88c5\u548c\u4f7f\u7528 mysql \u7eff\u8272\u7248\uff0c\u4e00\u79cd\u65e0\u9700\u5b89\u88c5\u5373\u53ef\u8fd0\u884c\u7684\u4fbf\u643a\u5f0f\u6570\u636e\u5e93\u3002mysql \u662f\u4e00\u79cd\u5e7f\u6cdb\u4f7f\u7528\u7684\u5173\u7cfb\u578b\u6570\u636e\u5e93\u7ba1\u7406\u7cfb\u7edf\uff0c\u56e0\u5176\u901f\u5ea6\u3001\u53ef\u9760\u6027\u548c\u53ef\u6269\u5c55\u6027\u800c\u95fb\u540d\u3002\u672c\u6559\u7a0b\u65e8\u5728\u5e2e\u52a9\u521d\u5b66\u8005\u548c\u6709\u7ecf\u9a8c\u7684\u7528\u6237\u5feb\u901f\u4e0a\u624b mysql \u7eff\u8272\u7248\uff0c\u5e76\u53ef\u4ee5\u8f7b\u677e\u5730\u5728\u5404\u79cd\u5e73\u53f0\uff08\u5305\u62ec windows\u3001macos \u548c linux\uff09\u4e0a\u8fd0\u884c\u3002\n<\/p><\/blockquote>\n<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/202410\/17\/2024101714311163043.jpg\" class=\"aligncenter\" title=\"mysql\u5b89\u88c5\u4f7f\u7528\u6559\u7a0b \u7eff\u8272\u7248\u7684mysql\u5b89\u88c5\u6559\u7a0b\u63d2\u56fe\" alt=\"mysql\u5b89\u88c5\u4f7f\u7528\u6559\u7a0b \u7eff\u8272\u7248\u7684mysql\u5b89\u88c5\u6559\u7a0b\u63d2\u56fe\" \/><\/p>\n<p style=\"margin-top: 0px;margin-bottom: 9px;font-family:\"><strong>MySQL \u7eff\u8272\u7248\u5b89\u88c5\u6559\u7a0b<\/strong><\/p>\n<p style=\"margin-top: 0px;margin-bottom: 9px;font-family:\"><strong>\u4e00\u3001\u4e0b\u8f7d\u7eff\u8272\u7248 MySQL<\/strong><\/p>\n<ul>\n<li>\u524d\u5f80 MySQL \u5b98\u65b9\u4e0b\u8f7d\u9875\u9762\uff0c\u9009\u62e9\u7eff\u8272\u7248 MySQL\u3002<\/li>\n<li>\u6839\u636e\u60a8\u7684\u9009\u62e9\u76f8\u5e94\u7684\u4e0b\u8f7d\u94fe\u63a5\uff08Windows\u3001Linux\u3001macOS\uff09\u3002<\/li>\n<\/ul>\n<p style=\"margin-top: 0px;margin-bottom: 9px;font-family:\"><strong>\u4e8c\u3001\u5b89\u88c5 MySQL \u7eff\u8272\u7248<\/strong><\/p>\n<ol>\n<li>\u89e3\u538b\u7f29\u4e0b\u8f7d\u7684\u538b\u7f29\u5305\u5230\u6307\u5b9a\u7684\u6587\u4ef6\u5939\u3002<\/li>\n<li>\u6253\u5f00\u89e3\u538b\u540e\u7684\u6587\u4ef6\u5939\uff0c\u53cc\u51fb &#8220;MySQL Installer.exe&#8221;\uff08Windows\uff09\u3001&#8221;run_install.sh&#8221;\uff08Linux\uff09\u3001&#8221;-installer&#8221;\uff08macOS\uff09\u5f00\u59cb\u5b89\u88c5\u3002<\/li>\n<li>\u9009\u62e9 &#8220;Custom\uff08\u81ea\u5b9a\u4e49\uff09&#8221; \u5b89\u88c5\u7c7b\u578b\uff0c\u53d6\u6d88\u52fe\u9009\u6240\u6709\u975e\u5fc5\u9700\u7ec4\u4ef6\uff08\u5982 Workbench\uff09\u3002<\/li>\n<li>\u9009\u62e9\u5b89\u88c5\u8def\u5f84\uff0c\u5efa\u8bae\u5b89\u88c5\u5728\u975e\u7cfb\u7edf\u76d8\u3002<\/li>\n<li>\u5b8c\u6210\u5b89\u88c5\u540e\uff0c\u70b9\u51fb &#8220;Finish&#8221; \u9000\u51fa\u5b89\u88c5\u7a0b\u5e8f\u3002<\/li>\n<\/ol>\n<p style=\"margin-top: 0px;margin-bottom: 9px;font-family:\"><strong>\u4e09\u3001\u914d\u7f6e MySQL \u670d\u52a1<\/strong><\/p>\n<ol>\n<li>\u6253\u5f00 &#8220;MySQL Installer&#8221; \u5de5\u5177\uff0c\u9009\u62e9 &#8220;Service Configuration&#8221;\u3002<\/li>\n<li>\u5728 &#8220;General&#8221; \u9009\u9879\u5361\u4e2d\uff0c\u52fe\u9009 &#8220;Install and Configure&#8221;\u3002<\/li>\n<li>\u5728 &#8220;Logon Account&#8221; \u9009\u9879\u5361\u4e2d\uff0c\u9009\u62e9 &#8220;Automatic&#8221; \u4f5c\u4e3a\u670d\u52a1\u767b\u5f55\u8d26\u6237\u3002<\/li>\n<li>\u5728 &#8220;Startup Type&#8221; \u9009\u9879\u5361\u4e2d\uff0c\u9009\u62e9 &#8220;Automatic&#8221; \u4f5c\u4e3a\u670d\u52a1\u542f\u52a8\u7c7b\u578b\u3002<\/li>\n<li>\u5728 &#8220;Ports&#8221; \u9009\u9879\u5361\u4e2d\uff0c\u786e\u8ba4 MySQL \u7684\u9ed8\u8ba4\u7aef\u53e3\u53f7\u4e3a 3306\u3002<\/li>\n<li>\u70b9\u51fb &#8220;Apply&#8221; \u548c &#8220;Start&#8221; \u6309\u94ae\u542f\u52a8 MySQL \u670d\u52a1\u3002<\/li>\n<\/ol>\n<p style=\"margin-top: 0px;margin-bottom: 9px;font-family:\"><strong>\u56db\u3001\u8fde\u63a5 MySQL \u6570\u636e\u5e93<\/strong><\/p>\n<ol>\n<li>\u6253\u5f00 MySQL \u63a7\u5236\u53f0\uff08\u547d\u4ee4\u884c\u5de5\u5177\uff09\u3002<\/li>\n<li>\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\u8fde\u63a5\u5230 MySQL \u6570\u636e\u5e93\uff1a<\/li>\n<\/ol>\n<pre>mysql&nbsp;-h&nbsp;localhost&nbsp;-u&nbsp;root&nbsp;-p<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<ul>\n<li>&#8220;localhost&#8221; \u4e3a MySQL \u670d\u52a1\u6240\u5728\u7684\u4e3b\u673a\u3002<\/li>\n<li>&#8220;root&#8221; \u4e3a MySQL \u7684\u9ed8\u8ba4\u7528\u6237\u540d\u3002<\/li>\n<li>&#8220;p&#8221; \u540e\u9762\u8f93\u5165\u60a8\u7684 MySQL \u5bc6\u7801\u3002<\/li>\n<\/ul>\n<p style=\"margin-top: 0px;margin-bottom: 9px;font-family:\"><strong>\u4e94\u3001\u4f7f\u7528 MySQL<\/strong><\/p>\n<ol>\n<li>\u521b\u5efa\u65b0\u6570\u636e\u5e93\uff1a<\/li>\n<\/ol>\n<pre>CREATE&nbsp;DATABASE&nbsp;database_name;<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<ol>\n<li>\u8fdb\u5165\u65b0\u6570\u636e\u5e93\uff1a<\/li>\n<\/ol>\n<pre>USE&nbsp;database_name;<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<ol>\n<li>\u521b\u5efa\u65b0\u8868\uff1a<\/li>\n<\/ol>\n<pre>CREATE&nbsp;TABLE&nbsp;table_name&nbsp;(\n&nbsp;&nbsp;&nbsp;&nbsp;id&nbsp;INT&nbsp;NOT&nbsp;NULL&nbsp;AUTO_INCREMENT,\n&nbsp;&nbsp;&nbsp;&nbsp;name&nbsp;VARCHAR(255)&nbsp;NOT&nbsp;NULL,\n&nbsp;&nbsp;&nbsp;&nbsp;PRIMARY&nbsp;KEY&nbsp;(id)\n);<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<ol>\n<li>\u63d2\u5165\u6570\u636e\uff1a<\/li>\n<\/ol>\n<pre>INSERT&nbsp;INTO&nbsp;table_name&nbsp;(name)&nbsp;VALUES&nbsp;('John&nbsp;Doe');<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<ol>\n<li>\u67e5\u8be2\u6570\u636e\uff1a<\/li>\n<\/ol>\n<pre>SELECT&nbsp;*&nbsp;FROM&nbsp;table_name;<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u4ee5\u4e0a\u5c31\u662f\u5b89\u88c5\u4f7f\u7528\u6559\u7a0b \u7eff\u8272\u7248\u7684mysql\u5b89\u88c5\u6559\u7a0b\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>\u672c\u6559\u7a0b\u5c06\u8be6\u7ec6\u4ecb\u7ecd\u5982\u4f55\u5b89\u88c5\u548c\u4f7f\u7528 mysql \u7eff\u8272\u7248\uff0c\u4e00\u79cd\u65e0\u9700\u5b89\u88c5\u5373\u53ef\u8fd0\u884c\u7684\u4fbf\u643a\u5f0f\u6570\u636e\u5e93\u3002mysql \u662f\u4e00\u79cd\u5e7f\u6cdb\u4f7f\u7528\u7684\u5173\u7cfb\u578b\u6570\u636e\u5e93\u7ba1\u7406\u7cfb\u7edf\uff0c\u56e0\u5176\u901f\u5ea6\u3001\u53ef\u9760\u6027\u548c\u53ef\u6269\u5c55\u6027\u800c\u95fb\u540d\u3002\u672c\u6559\u7a0b\u65e8\u5728\u5e2e\u52a9\u521d\u5b66\u8005\u548c\u6709\u7ecf\u9a8c\u7684\u7528\u6237\u5feb\u901f\u4e0a\u624b mysql \u7eff\u8272\u7248\uff0c\u5e76\u53ef\u4ee5\u8f7b\u677e\u5730\u5728\u5404\u79cd\u5e73\u53f0\uff08\u5305\u62ec windows\u3001macos \u548c linux\uff09\u4e0a\u8fd0\u884c\u3002 MySQL \u7eff\u8272\u7248\u5b89\u88c5\u6559\u7a0b \u4e00\u3001\u4e0b\u8f7d\u7eff\u8272\u7248 MySQL \u524d\u5f80 MySQL \u5b98\u65b9\u4e0b\u8f7d\u9875\u9762\uff0c\u9009\u62e9\u7eff\u8272\u7248 MySQL\u3002 \u6839\u636e\u60a8\u7684\u9009\u62e9\u76f8\u5e94\u7684\u4e0b\u8f7d\u94fe\u63a5\uff08Windows\u3001Linux\u3001macOS\uff09\u3002 \u4e8c\u3001\u5b89\u88c5 MySQL \u7eff\u8272\u7248 \u89e3\u538b\u7f29\u4e0b\u8f7d\u7684\u538b\u7f29\u5305\u5230\u6307\u5b9a\u7684\u6587\u4ef6\u5939\u3002 \u6253\u5f00\u89e3\u538b\u540e\u7684\u6587\u4ef6\u5939\uff0c\u53cc\u51fb &#8220;MySQL Installer.exe&#8221;\uff08Windows\uff09\u3001&#8221;run_install.sh&#8221;\uff08Linux\uff09\u3001&#8221;-installer&#8221;\uff08macOS\uff09\u5f00\u59cb\u5b89\u88c5\u3002 \u9009\u62e9 &#8220;Custom\uff08\u81ea\u5b9a\u4e49\uff09&#8221; \u5b89\u88c5\u7c7b\u578b\uff0c\u53d6\u6d88\u52fe\u9009\u6240\u6709\u975e\u5fc5\u9700\u7ec4\u4ef6\uff08\u5982 Workbench\uff09\u3002 \u9009\u62e9\u5b89\u88c5\u8def\u5f84\uff0c\u5efa\u8bae\u5b89\u88c5\u5728\u975e\u7cfb\u7edf\u76d8\u3002 \u5b8c\u6210\u5b89\u88c5\u540e\uff0c\u70b9\u51fb &#8220;Finish&#8221; \u9000\u51fa\u5b89\u88c5\u7a0b\u5e8f\u3002 \u4e09\u3001\u914d\u7f6e MySQL \u670d\u52a1 \u6253\u5f00 &#8220;MySQL Installer&#8221; \u5de5\u5177\uff0c\u9009\u62e9 &#8220;Service Configuration&#8221;\u3002 \u5728 &#8220;General&#8221; \u9009\u9879\u5361\u4e2d\uff0c\u52fe\u9009 &#8220;Install and Configure&#8221;\u3002 \u5728 &#8220;Logon Account&#8221; \u9009\u9879\u5361\u4e2d\uff0c\u9009\u62e9 &#8220;Automatic&#8221; \u4f5c\u4e3a\u670d\u52a1\u767b\u5f55\u8d26\u6237\u3002 \u5728 [&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-6676","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/6676","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=6676"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/6676\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=6676"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=6676"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=6676"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}