{"id":6680,"date":"2024-11-14T08:12:12","date_gmt":"2024-11-14T00:12:12","guid":{"rendered":"https:\/\/fwq.ai\/blog\/6680\/"},"modified":"2024-11-14T08:12:12","modified_gmt":"2024-11-14T00:12:12","slug":"mysql%e5%ae%89%e8%a3%85%e5%a5%bd%e5%a6%82%e4%bd%95%e4%bd%bf%e7%94%a8-mysql%e5%ae%89%e8%a3%85%e4%b8%8e%e7%ae%80%e5%8d%95%e4%bd%bf%e7%94%a8%e6%95%99%e7%a8%8b","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/6680\/","title":{"rendered":"mysql\u5b89\u88c5\u597d\u5982\u4f55\u4f7f\u7528 mysql\u5b89\u88c5\u4e0e\u7b80\u5355\u4f7f\u7528\u6559\u7a0b"},"content":{"rendered":"<blockquote><p>\n  mysql \u662f\u4e00\u6b3e\u6d41\u884c\u7684\u5f00\u6e90\u5173\u7cfb\u578b\u6570\u636e\u5e93\u7ba1\u7406\u7cfb\u7edf (rdbms)\u3002\u672c\u6587\u5c06\u6307\u5bfc\u60a8\u5982\u4f55\u5b89\u88c5\u548c\u4f7f\u7528 mysql\uff0c\u4ee5\u4fbf\u60a8\u53ef\u4ee5\u5b58\u50a8\u548c\u7ba1\u7406\u60a8\u7684\u6570\u636e\u3002\u9996\u5148\uff0c\u6211\u4eec\u5c06\u5f15\u5bfc\u60a8\u5b8c\u6210\u5b89\u88c5\u8fc7\u7a0b\uff0c\u7136\u540e\u4ecb\u7ecd\u57fa\u672c\u7684 mysql \u547d\u4ee4\uff0c\u4f7f\u60a8\u80fd\u591f\u521b\u5efa\u6570\u636e\u5e93\u3001\u63d2\u5165\u6570\u636e\u5e76\u68c0\u7d22\u4fe1\u606f\u3002\n<\/p><\/blockquote>\n<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/202410\/17\/2024101714414282365.jpg\" class=\"aligncenter\" title=\"mysql\u5b89\u88c5\u597d\u5982\u4f55\u4f7f\u7528 mysql\u5b89\u88c5\u4e0e\u7b80\u5355\u4f7f\u7528\u6559\u7a0b\u63d2\u56fe\" alt=\"mysql\u5b89\u88c5\u597d\u5982\u4f55\u4f7f\u7528 mysql\u5b89\u88c5\u4e0e\u7b80\u5355\u4f7f\u7528\u6559\u7a0b\u63d2\u56fe\" \/><\/p>\n<h2>MySQL \u5b89\u88c5\u4e0e\u7b80\u5355\u4f7f\u7528\u6559\u7a0b<\/h2>\n<h3>1. \u5b89\u88c5 MySQL<\/h3>\n<p style=\"margin-top: 0px;margin-bottom: 9px;font-family:\"><strong>Windows \u7cfb\u7edf\uff1a<\/strong><\/p>\n<ol>\n<li>\u4e0b\u8f7d MySQL \u5b89\u88c5\u5305\uff1ahttps:\/\/dev..com\/downloads\/mysql<\/li>\n<li>\u8fd0\u884c\u5b89\u88c5\u7a0b\u5e8f\u5e76\u6309\u7167\u63d0\u793a\u64cd\u4f5c\u3002<\/li>\n<\/ol>\n<p style=\"margin-top: 0px;margin-bottom: 9px;font-family:\"><strong>MacOS \u7cfb\u7edf\uff1a<\/strong><\/p>\n<ol>\n<li>\u5b89\u88c5 Homebrew\uff1ahttps:\/\/brew.sh\/<\/li>\n<li>\u5728\u7ec8\u7aef\u4e2d\u8f93\u5165\uff1abrew install mysql<\/li>\n<\/ol>\n<p style=\"margin-top: 0px;margin-bottom: 9px;font-family:\"><strong>Linux \u7cfb\u7edf\uff1a<\/strong><\/p>\n<ol>\n<li>Red Hat\/CentOS\uff1ayum install mysql-server<\/li>\n<li>Debian\/Ubuntu\uff1aapt-get install mysql-server<\/li>\n<\/ol>\n<h3>2. \u542f\u52a8 MySQL \u670d\u52a1<\/h3>\n<p style=\"margin-top: 0px;margin-bottom: 9px;font-family:\"><strong>Windows \u7cfb\u7edf\uff1a<\/strong><\/p>\n<ol>\n<li>\u6253\u5f00 Windows \u670d\u52a1\u7ba1\u7406\u5668\u3002<\/li>\n<li>\u627e\u5230 MySQL \u670d\u52a1\uff0c\u53f3\u952e\u5355\u51fb\u5e76\u9009\u62e9\u201c\u542f\u52a8\u201d\u3002<\/li>\n<\/ol>\n<p style=\"margin-top: 0px;margin-bottom: 9px;font-family:\"><strong>MacOS \u7cfb\u7edf\uff1a<\/strong><\/p>\n<pre>mysql.server&nbsp;start<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p style=\"margin-top: 0px;margin-bottom: 9px;font-family:\"><strong>Linux \u7cfb\u7edf\uff1a<\/strong><\/p>\n<pre>systemctl&nbsp;start&nbsp;mysqld<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<h3>3. \u767b\u5f55 MySQL<\/h3>\n<p style=\"margin-top: 0px;margin-bottom: 9px;font-family:\"><strong>Windows \u7cfb\u7edf\uff1a<\/strong><\/p>\n<ol>\n<li>\u6253\u5f00 MySQL \u547d\u4ee4\u884c\u5de5\u5177\uff08MySQL Shell\uff09\u3002<\/li>\n<li>\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\uff1amysql -u root -p password<\/li>\n<\/ol>\n<p style=\"margin-top: 0px;margin-bottom: 9px;font-family:\"><strong>MacOS\/Linux \u7cfb\u7edf\uff1a<\/strong><\/p>\n<pre>mysql&nbsp;-u&nbsp;root&nbsp;-p&nbsp;password<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p style=\"margin-top: 0px;margin-bottom: 9px;font-family:\">\u5176\u4e2d\uff1a<\/p>\n<ul>\n<li>root&nbsp;\u4e3a\u9ed8\u8ba4\u7528\u6237\u540d<\/li>\n<li>password&nbsp;\u4e3a\u9ed8\u8ba4\u5bc6\u7801<\/li>\n<\/ul>\n<h3>4. \u521b\u5efa\u6570\u636e\u5e93<\/h3>\n<pre>CREATE&nbsp;DATABASE&nbsp;mydatabase;<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<h3>5. \u521b\u5efa\u8868<\/h3>\n<pre>CREATE&nbsp;TABLE&nbsp;mytable&nbsp;(\n&nbsp;&nbsp;id&nbsp;INT&nbsp;NOT&nbsp;NULL&nbsp;AUTO_INCREMENT,\n&nbsp;&nbsp;name&nbsp;VARCHAR(255)&nbsp;NOT&nbsp;NULL,\n&nbsp;&nbsp;age&nbsp;INT&nbsp;NOT&nbsp;NULL,\n&nbsp;&nbsp;PRIMARY&nbsp;KEY&nbsp;(id)\n);<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<h3>6. \u63d2\u5165\u6570\u636e<\/h3>\n<pre>INSERT&nbsp;INTO&nbsp;mytable&nbsp;(name,&nbsp;age)&nbsp;VALUES&nbsp;('John&nbsp;Doe',&nbsp;25);<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<h3>7. \u67e5\u8be2\u6570\u636e<\/h3>\n<pre>SELECT&nbsp;*&nbsp;FROM&nbsp;mytable;<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<h3>8. \u5220\u9664\u6570\u636e<\/h3>\n<pre>DELETE&nbsp;FROM&nbsp;mytable&nbsp;WHERE&nbsp;id&nbsp;=&nbsp;1;<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<h3>9. \u9000\u51fa MySQL<\/h3>\n<pre>EXIT;<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u4ee5\u4e0a\u5c31\u662f\u5b89\u88c5\u597d\u5982\u4f55\u4f7f\u7528 mysql\u5b89\u88c5\u4e0e\u7b80\u5355\u4f7f\u7528\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>mysql \u662f\u4e00\u6b3e\u6d41\u884c\u7684\u5f00\u6e90\u5173\u7cfb\u578b\u6570\u636e\u5e93\u7ba1\u7406\u7cfb\u7edf (rdbms)\u3002\u672c\u6587\u5c06\u6307\u5bfc\u60a8\u5982\u4f55\u5b89\u88c5\u548c\u4f7f\u7528 mysql\uff0c\u4ee5\u4fbf\u60a8\u53ef\u4ee5\u5b58\u50a8\u548c\u7ba1\u7406\u60a8\u7684\u6570\u636e\u3002\u9996\u5148\uff0c\u6211\u4eec\u5c06\u5f15\u5bfc\u60a8\u5b8c\u6210\u5b89\u88c5\u8fc7\u7a0b\uff0c\u7136\u540e\u4ecb\u7ecd\u57fa\u672c\u7684 mysql \u547d\u4ee4\uff0c\u4f7f\u60a8\u80fd\u591f\u521b\u5efa\u6570\u636e\u5e93\u3001\u63d2\u5165\u6570\u636e\u5e76\u68c0\u7d22\u4fe1\u606f\u3002 MySQL \u5b89\u88c5\u4e0e\u7b80\u5355\u4f7f\u7528\u6559\u7a0b 1. \u5b89\u88c5 MySQL Windows \u7cfb\u7edf\uff1a \u4e0b\u8f7d MySQL \u5b89\u88c5\u5305\uff1ahttps:\/\/dev..com\/downloads\/mysql \u8fd0\u884c\u5b89\u88c5\u7a0b\u5e8f\u5e76\u6309\u7167\u63d0\u793a\u64cd\u4f5c\u3002 MacOS \u7cfb\u7edf\uff1a \u5b89\u88c5 Homebrew\uff1ahttps:\/\/brew.sh\/ \u5728\u7ec8\u7aef\u4e2d\u8f93\u5165\uff1abrew install mysql Linux \u7cfb\u7edf\uff1a Red Hat\/CentOS\uff1ayum install mysql-server Debian\/Ubuntu\uff1aapt-get install mysql-server 2. \u542f\u52a8 MySQL \u670d\u52a1 Windows \u7cfb\u7edf\uff1a \u6253\u5f00 Windows \u670d\u52a1\u7ba1\u7406\u5668\u3002 \u627e\u5230 MySQL \u670d\u52a1\uff0c\u53f3\u952e\u5355\u51fb\u5e76\u9009\u62e9\u201c\u542f\u52a8\u201d\u3002 MacOS \u7cfb\u7edf\uff1a mysql.server&nbsp;start \u767b\u5f55\u540e\u590d\u5236 Linux \u7cfb\u7edf\uff1a systemctl&nbsp;start&nbsp;mysqld \u767b\u5f55\u540e\u590d\u5236 3. \u767b\u5f55 [&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-6680","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/6680","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=6680"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/6680\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=6680"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=6680"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=6680"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}