{"id":44852,"date":"2024-12-01T11:15:09","date_gmt":"2024-12-01T03:15:09","guid":{"rendered":"https:\/\/fwq.ai\/blog\/44852\/"},"modified":"2024-12-01T11:15:09","modified_gmt":"2024-12-01T03:15:09","slug":"%e5%a6%82%e4%bd%95%e5%88%a9%e7%94%a8mysql%e5%ad%98%e5%82%a8%e5%92%8c%e7%ae%a1%e7%90%86%e5%bf%ab%e9%80%92%e8%bf%90%e8%be%93%e8%bd%a8%e8%bf%b9%e4%bf%a1%e6%81%af%ef%bc%9f-2","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/44852\/","title":{"rendered":"\u5982\u4f55\u5229\u7528MySQL\u5b58\u50a8\u548c\u7ba1\u7406\u5feb\u9012\u8fd0\u8f93\u8f68\u8ff9\u4fe1\u606f\uff1f"},"content":{"rendered":"<p><b><\/b> <\/p>\n<h1>\u5982\u4f55\u5229\u7528MySQL\u5b58\u50a8\u548c\u7ba1\u7406\u5feb\u9012\u8fd0\u8f93\u8f68\u8ff9\u4fe1\u606f\uff1f<\/h1>\n<p>\u77e5\u8bc6\u70b9\u638c\u63e1\u4e86\uff0c\u8fd8\u9700\u8981\u4e0d\u65ad\u7ec3\u4e60\u624d\u80fd\u719f\u7ec3\u8fd0\u7528\u3002\u4e0b\u9762\u7c73\u4e91\u7ed9\u5927\u5bb6\u5e26\u6765\u4e00\u4e2a\u6570\u636e\u5e93\u5f00\u53d1\u5b9e\u6218\uff0c\u624b\u628a\u624b\u6559\u5927\u5bb6\u5b66\u4e60\u300a\u5982\u4f55\u5229\u7528MySQL\u5b58\u50a8\u548c\u7ba1\u7406\u5feb\u9012\u8fd0\u8f93\u8f68\u8ff9\u4fe1\u606f\uff1f\u300b\uff0c\u5728\u5b9e\u73b0\u529f\u80fd\u7684\u8fc7\u7a0b\u4e2d\u4e5f\u5e26\u5927\u5bb6\u91cd\u65b0\u6e29\u4e60\u76f8\u5173\u77e5\u8bc6\u70b9\uff0c\u6e29\u6545\u800c\u77e5\u65b0\uff0c\u56de\u5934\u770b\u770b\u8bf4\u4e0d\u5b9a\u53c8\u6709\u4e0d\u4e00\u6837\u7684\u611f\u609f\uff01<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.17golang.com\/uploads\/20241103\/17305988856726d7e57914d.jpg\" class=\"aligncenter\" title=\"\u5982\u4f55\u5229\u7528MySQL\u5b58\u50a8\u548c\u7ba1\u7406\u5feb\u9012\u8fd0\u8f93\u8f68\u8ff9\u4fe1\u606f\uff1f\u63d2\u56fe\" alt=\"\u5982\u4f55\u5229\u7528MySQL\u5b58\u50a8\u548c\u7ba1\u7406\u5feb\u9012\u8fd0\u8f93\u8f68\u8ff9\u4fe1\u606f\uff1f\u63d2\u56fe\" \/><\/p>\n<p><strong>mysql \u4e2d\u5feb\u9012\u8fd0\u8f93\u8f68\u8ff9\u5b58\u50a8\u65b9\u5f0f<\/strong><\/p>\n<p>\u5b58\u50a8\u5feb\u9012\u8fd0\u8f93\u8f68\u8ff9\u65f6\uff0c\u6211\u4eec\u9996\u5148\u8003\u8651\u5c06\u56fa\u5b9a\u7684\u4fe1\u606f\uff08\u5982\u5feb\u9012\u516c\u53f8\u540d\u79f0\u3001\u4ee3\u7801\u548c\u5355\u53f7\uff09\u5b58\u50a8\u5728\u4e13\u5c5e\u5b57\u6bb5\u4e2d\uff0c\u56e0\u4e3a\u8fd9\u4e9b\u4fe1\u606f\u901a\u5e38\u9700\u8981\u88ab\u68c0\u7d22\u3002\u4f8b\u5982\uff1a<\/p>\n<pre>create table expresses (\n  express_company varchar(255) not null,\n  express_code varchar(255) not null,\n  express_number varchar(255) not null,\n  ...\n);<\/pre>\n<p>\u5bf9\u4e8e\u52a8\u6001\u7684\u4fe1\u606f\uff0c\u5982\u5feb\u9012\u9014\u5f84\u548c\u4e2d\u8f6c\u4fe1\u606f\uff0c\u7531\u4e8e\u5176\u4e0d\u5e38\u7528\u6765\u67e5\u8be2\uff0c\u6211\u4eec\u53ef\u4ee5\u8003\u8651\u5c06\u5176\u5b58\u50a8\u4e3a json \u683c\u5f0f\u3002\u8fd9\u5c06\u5141\u8bb8\u6211\u4eec\u7075\u6d3b\u5730\u5b58\u50a8\u548c\u68c0\u7d22\u8fd9\u4e9b\u4fe1\u606f\u3002\u4f8b\u5982\uff1a<\/p>\n<pre>alter table expresses\nadd column trajectory json;<\/pre>\n<p>\u5728 json \u4e2d\uff0c\u6211\u4eec\u53ef\u4ee5\u5b58\u50a8\u4efb\u4f55\u76f8\u5173\u4fe1\u606f\uff0c\u5982\uff1a<\/p>\n<pre>{\n  \"waypoints\": [\n    {\n      \"location\": \"\u6df1\u5733\",\n      \"time\": \"2023-03-08 10:00:00\"\n    },\n    {\n      \"location\": \"\u5e7f\u5dde\",\n      \"time\": \"2023-03-09 18:00:00\"\n    }\n  ],\n  \"transits\": [\n    {\n      \"from\": \"\u6df1\u5733\u8f6c\u8fd0\u4e2d\u5fc3\",\n      \"to\": \"\u5e7f\u5dde\u5206\u62e8\u4e2d\u5fc3\"\n    }\n  ]\n}<\/pre>\n<p>\u8fd9\u79cd\u65b9\u5f0f\u65e2\u7075\u6d3b\u53c8\u65b9\u4fbf\u68c0\u7d22\uff0c\u53ef\u4ee5\u6ee1\u8db3\u6211\u4eec\u5b58\u50a8\u5feb\u9012\u8fd0\u8f93\u8f68\u8ff9\u7684\u9700\u8981\u3002<\/p>\n<p>\u5230\u8fd9\u91cc\uff0c\u6211\u4eec\u4e5f\u5c31\u8bb2\u5b8c\u4e86\u300a\u5982\u4f55\u5229\u7528MySQL\u5b58\u50a8\u548c\u7ba1\u7406\u5feb\u9012\u8fd0\u8f93\u8f68\u8ff9\u4fe1\u606f\uff1f\u300b\u7684\u5185\u5bb9\u4e86\u3002\u4e2a\u4eba\u8ba4\u4e3a\uff0c\u57fa\u7840\u77e5\u8bc6\u7684\u5b66\u4e60\u548c\u5de9\u56fa\uff0c\u662f\u4e3a\u4e86\u66f4\u597d\u7684\u5c06\u5176\u8fd0\u7528\u5230\u9879\u76ee\u4e2d\uff0c\u6b22\u8fce\u5173\u6ce8\u7c73\u4e91\u516c\u4f17\u53f7\uff0c\u5e26\u4f60\u4e86\u89e3\u66f4\u591a\u5173\u4e8e\u7684\u77e5\u8bc6\u70b9\uff01<\/p>\n<dl>\n<dt>\n <\/dt>\n<\/dl>\n","protected":false},"excerpt":{"rendered":"<p>\u5982\u4f55\u5229\u7528MySQL\u5b58\u50a8\u548c\u7ba1\u7406\u5feb\u9012\u8fd0\u8f93\u8f68\u8ff9\u4fe1\u606f\uff1f \u77e5\u8bc6\u70b9\u638c\u63e1\u4e86\uff0c\u8fd8\u9700\u8981\u4e0d\u65ad\u7ec3\u4e60\u624d\u80fd\u719f\u7ec3\u8fd0\u7528\u3002\u4e0b\u9762\u7c73\u4e91\u7ed9\u5927\u5bb6\u5e26\u6765\u4e00\u4e2a\u6570\u636e\u5e93\u5f00\u53d1\u5b9e\u6218\uff0c\u624b\u628a\u624b\u6559\u5927\u5bb6\u5b66\u4e60\u300a\u5982\u4f55\u5229\u7528MySQL\u5b58\u50a8\u548c\u7ba1\u7406\u5feb\u9012\u8fd0\u8f93\u8f68\u8ff9\u4fe1\u606f\uff1f\u300b\uff0c\u5728\u5b9e\u73b0\u529f\u80fd\u7684\u8fc7\u7a0b\u4e2d\u4e5f\u5e26\u5927\u5bb6\u91cd\u65b0\u6e29\u4e60\u76f8\u5173\u77e5\u8bc6\u70b9\uff0c\u6e29\u6545\u800c\u77e5\u65b0\uff0c\u56de\u5934\u770b\u770b\u8bf4\u4e0d\u5b9a\u53c8\u6709\u4e0d\u4e00\u6837\u7684\u611f\u609f\uff01 mysql \u4e2d\u5feb\u9012\u8fd0\u8f93\u8f68\u8ff9\u5b58\u50a8\u65b9\u5f0f \u5b58\u50a8\u5feb\u9012\u8fd0\u8f93\u8f68\u8ff9\u65f6\uff0c\u6211\u4eec\u9996\u5148\u8003\u8651\u5c06\u56fa\u5b9a\u7684\u4fe1\u606f\uff08\u5982\u5feb\u9012\u516c\u53f8\u540d\u79f0\u3001\u4ee3\u7801\u548c\u5355\u53f7\uff09\u5b58\u50a8\u5728\u4e13\u5c5e\u5b57\u6bb5\u4e2d\uff0c\u56e0\u4e3a\u8fd9\u4e9b\u4fe1\u606f\u901a\u5e38\u9700\u8981\u88ab\u68c0\u7d22\u3002\u4f8b\u5982\uff1a create table expresses ( express_company varchar(255) not null, express_code varchar(255) not null, express_number varchar(255) not null, &#8230; ); \u5bf9\u4e8e\u52a8\u6001\u7684\u4fe1\u606f\uff0c\u5982\u5feb\u9012\u9014\u5f84\u548c\u4e2d\u8f6c\u4fe1\u606f\uff0c\u7531\u4e8e\u5176\u4e0d\u5e38\u7528\u6765\u67e5\u8be2\uff0c\u6211\u4eec\u53ef\u4ee5\u8003\u8651\u5c06\u5176\u5b58\u50a8\u4e3a json \u683c\u5f0f\u3002\u8fd9\u5c06\u5141\u8bb8\u6211\u4eec\u7075\u6d3b\u5730\u5b58\u50a8\u548c\u68c0\u7d22\u8fd9\u4e9b\u4fe1\u606f\u3002\u4f8b\u5982\uff1a alter table expresses add column trajectory json; \u5728 json \u4e2d\uff0c\u6211\u4eec\u53ef\u4ee5\u5b58\u50a8\u4efb\u4f55\u76f8\u5173\u4fe1\u606f\uff0c\u5982\uff1a { &#8220;waypoints&#8221;: [ { &#8220;location&#8221;: &#8220;\u6df1\u5733&#8221;, &#8220;time&#8221;: &#8220;2023-03-08 10:00:00&#8221; }, { &#8220;location&#8221;: &#8220;\u5e7f\u5dde&#8221;, &#8220;time&#8221;: &#8220;2023-03-09 18:00:00&#8221; } ], &#8220;transits&#8221;: [&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-44852","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/44852","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=44852"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/44852\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=44852"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=44852"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=44852"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}