{"id":25628,"date":"2024-11-24T10:11:56","date_gmt":"2024-11-24T02:11:56","guid":{"rendered":"https:\/\/fwq.ai\/blog\/25628\/"},"modified":"2024-11-24T10:11:56","modified_gmt":"2024-11-24T02:11:56","slug":"mysql-%e6%b3%a8%e9%87%8a%e7%ac%a6%e5%8f%b7%ef%bc%9a%e5%8d%95%e5%bc%95%e5%8f%b7%e8%bf%98%e6%98%af%e5%8f%8c%e5%bc%95%e5%8f%b7%ef%bc%9f-2","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/25628\/","title":{"rendered":"MySQL \u6ce8\u91ca\u7b26\u53f7\uff1a\u5355\u5f15\u53f7\u8fd8\u662f\u53cc\u5f15\u53f7\uff1f"},"content":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/001\/246\/273\/173064209471586.jpg\" class=\"aligncenter\" title=\"MySQL \u6ce8\u91ca\u7b26\u53f7\uff1a\u5355\u5f15\u53f7\u8fd8\u662f\u53cc\u5f15\u53f7\uff1f\u63d2\u56fe\" alt=\"MySQL \u6ce8\u91ca\u7b26\u53f7\uff1a\u5355\u5f15\u53f7\u8fd8\u662f\u53cc\u5f15\u53f7\uff1f\u63d2\u56fe\" \/><\/p>\n<p><strong>\u4e2d\u6ce8\u91ca\u7b26\u53f7\u7684\u6b63\u786e\u7528\u6cd5<\/strong><\/p>\n<p>\u5728mysql\u4e2d\uff0c\u6ce8\u91ca\u8bed\u6cd5\u4e2d\u660e\u786e\u6307\u51fa\uff0c\u6ce8\u91ca\u5185\u5bb9\u5e94\u4f7f\u7528\u82f1\u6587\u72b6\u6001\u4e0b\u7684\u5355\u5f15\u53f7(&#8216;)\u62ec\u8d77\u6765\u3002<\/p>\n<p><strong>\u60a8\u63d0\u5230\u7684\u95ee\u9898<\/strong><\/p>\n<p>\u60a8\u8868\u793a\u5728\u60a8\u7684\u60c5\u51b5\u4e0b\uff0c\u4f7f\u7528\u5355\u5f15\u53f7\u4f1a\u62a5\u9519\uff0c\u53ea\u80fd\u4f7f\u7528\u53cc\u5f15\u53f7\u3002\u8fd9\u53ef\u80fd\u662f\u56e0\u4e3a\u60a8\u5c06\u53cd\u5f15\u53f7(`)\u4e0e\u5355\u5f15\u53f7(&#8216;)\u6df7\u6dc6\u4e86\u3002<\/p>\n<p><strong>\u6b63\u786e\u7684\u6ce8\u91ca\u8bed\u6cd5<\/strong><\/p>\n<p>\u4ee5\u4e0b\u662fmysql\u4e2d\u8868\u6216\u5b57\u6bb5\u6ce8\u91ca\u8bed\u6cd5\u7684\u6b63\u786e\u793a\u4f8b\uff1a<\/p>\n<pre>-- \u4f7f\u7528\u53cd\u5f15\u53f7\u6807\u8bc6\u8868\u540d\u6216\u5b57\u6bb5\u540d\ncreate table `my_table` (\n  `id` int not null auto_increment,\n  `name` varchar(255) not null,\n  -- \u4f7f\u7528\u5355\u5f15\u53f7\u6807\u8bc6\u6ce8\u91ca\u5185\u5bb9\n  comment '\u8fd9\u4e2a\u8868\u683c\u5b58\u50a8\u4e86\u5ba2\u6237\u4fe1\u606f'\n) engine=innodb;<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p><strong>\u9519\u8bef\u7684\u793a\u4f8b<\/strong><\/p>\n<p>\u4ee5\u4e0b\u662f\u4f7f\u7528\u53cc\u5f15\u53f7\u6807\u8bc6\u6ce8\u91ca\u5185\u5bb9\u7684\u9519\u8bef\u793a\u4f8b\uff1a<\/p>\n<pre>-- \u4f7f\u7528\u53cd\u5f15\u53f7\u6807\u8bc6\u8868\u540d\u6216\u5b57\u6bb5\u540d\nCREATE TABLE `my_table` (\n  `id` INT NOT NULL AUTO_INCREMENT,\n  `name` VARCHAR(255) NOT NULL,\n  -- \u4f7f\u7528\u53cc\u5f15\u53f7\uff08\u9519\u8bef\uff09\n  COMMENT \"\u8fd9\u4e2a\u8868\u683c\u5b58\u50a8\u4e86\u5ba2\u6237\u4fe1\u606f\"\n) ENGINE=InnoDB;<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u56e0\u6b64\uff0c\u8bf7\u52a1\u5fc5\u4f7f\u7528\u82f1\u6587\u72b6\u6001\u4e0b\u7684\u5355\u5f15\u53f7(&#8216;)\u6765\u62ec\u8d77\u6ce8\u91ca\u5185\u5bb9\uff0c\u5e76\u4f7f\u7528\u53cd\u5f15\u53f7(`)\u6765\u6807\u8bc6\u8868\u540d\u6216\u5b57\u6bb5\u540d\uff0c\u4ee5\u907f\u514d\u4e0d\u5fc5\u8981\u7684\u9519\u8bef\u3002<\/p>\n<p>\u4ee5\u4e0a\u5c31\u662fMySQL \u6ce8\u91ca\u7b26\u53f7\uff1a\u5355\u5f15\u53f7\u8fd8\u662f\u53cc\u5f15\u53f7\uff1f\u7684\u8be6\u7ec6\u5185\u5bb9\uff0c\u66f4\u591a\u8bf7\u5173\u6ce8\u7c73\u4e91\u5176\u5b83\u76f8\u5173\u6587\u7ae0\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4e2d\u6ce8\u91ca\u7b26\u53f7\u7684\u6b63\u786e\u7528\u6cd5 \u5728mysql\u4e2d\uff0c\u6ce8\u91ca\u8bed\u6cd5\u4e2d\u660e\u786e\u6307\u51fa\uff0c\u6ce8\u91ca\u5185\u5bb9\u5e94\u4f7f\u7528\u82f1\u6587\u72b6\u6001\u4e0b\u7684\u5355\u5f15\u53f7(&#8216;)\u62ec\u8d77\u6765\u3002 \u60a8\u63d0\u5230\u7684\u95ee\u9898 \u60a8\u8868\u793a\u5728\u60a8\u7684\u60c5\u51b5\u4e0b\uff0c\u4f7f\u7528\u5355\u5f15\u53f7\u4f1a\u62a5\u9519\uff0c\u53ea\u80fd\u4f7f\u7528\u53cc\u5f15\u53f7\u3002\u8fd9\u53ef\u80fd\u662f\u56e0\u4e3a\u60a8\u5c06\u53cd\u5f15\u53f7(`)\u4e0e\u5355\u5f15\u53f7(&#8216;)\u6df7\u6dc6\u4e86\u3002 \u6b63\u786e\u7684\u6ce8\u91ca\u8bed\u6cd5 \u4ee5\u4e0b\u662fmysql\u4e2d\u8868\u6216\u5b57\u6bb5\u6ce8\u91ca\u8bed\u6cd5\u7684\u6b63\u786e\u793a\u4f8b\uff1a &#8212; \u4f7f\u7528\u53cd\u5f15\u53f7\u6807\u8bc6\u8868\u540d\u6216\u5b57\u6bb5\u540d create table `my_table` ( `id` int not null auto_increment, `name` varchar(255) not null, &#8212; \u4f7f\u7528\u5355\u5f15\u53f7\u6807\u8bc6\u6ce8\u91ca\u5185\u5bb9 comment &#8216;\u8fd9\u4e2a\u8868\u683c\u5b58\u50a8\u4e86\u5ba2\u6237\u4fe1\u606f&#8217; ) engine=innodb; \u767b\u5f55\u540e\u590d\u5236 \u9519\u8bef\u7684\u793a\u4f8b \u4ee5\u4e0b\u662f\u4f7f\u7528\u53cc\u5f15\u53f7\u6807\u8bc6\u6ce8\u91ca\u5185\u5bb9\u7684\u9519\u8bef\u793a\u4f8b\uff1a &#8212; \u4f7f\u7528\u53cd\u5f15\u53f7\u6807\u8bc6\u8868\u540d\u6216\u5b57\u6bb5\u540d CREATE TABLE `my_table` ( `id` INT NOT NULL AUTO_INCREMENT, `name` VARCHAR(255) NOT NULL, &#8212; \u4f7f\u7528\u53cc\u5f15\u53f7\uff08\u9519\u8bef\uff09 COMMENT &#8220;\u8fd9\u4e2a\u8868\u683c\u5b58\u50a8\u4e86\u5ba2\u6237\u4fe1\u606f&#8221; ) ENGINE=InnoDB; \u767b\u5f55\u540e\u590d\u5236 \u56e0\u6b64\uff0c\u8bf7\u52a1\u5fc5\u4f7f\u7528\u82f1\u6587\u72b6\u6001\u4e0b\u7684\u5355\u5f15\u53f7(&#8216;)\u6765\u62ec\u8d77\u6ce8\u91ca\u5185\u5bb9\uff0c\u5e76\u4f7f\u7528\u53cd\u5f15\u53f7(`)\u6765\u6807\u8bc6\u8868\u540d\u6216\u5b57\u6bb5\u540d\uff0c\u4ee5\u907f\u514d\u4e0d\u5fc5\u8981\u7684\u9519\u8bef\u3002 \u4ee5\u4e0a\u5c31\u662fMySQL \u6ce8\u91ca\u7b26\u53f7\uff1a\u5355\u5f15\u53f7\u8fd8\u662f\u53cc\u5f15\u53f7\uff1f\u7684\u8be6\u7ec6\u5185\u5bb9\uff0c\u66f4\u591a\u8bf7\u5173\u6ce8\u7c73\u4e91\u5176\u5b83\u76f8\u5173\u6587\u7ae0\uff01<\/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-25628","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/25628","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=25628"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/25628\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=25628"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=25628"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=25628"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}