{"id":7391,"date":"2024-11-14T09:15:59","date_gmt":"2024-11-14T01:15:59","guid":{"rendered":"https:\/\/fwq.ai\/blog\/7391\/"},"modified":"2024-11-14T09:15:59","modified_gmt":"2024-11-14T01:15:59","slug":"mysql%e7%b4%a2%e5%bc%95%e6%94%af%e6%8c%81%e5%93%aa%e4%ba%9b%e5%ad%97%e6%ae%b5%e7%b1%bb%e5%9e%8b%ef%bc%9f","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/7391\/","title":{"rendered":"MySQL\u7d22\u5f15\u652f\u6301\u54ea\u4e9b\u5b57\u6bb5\u7c7b\u578b\uff1f"},"content":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/001\/246\/273\/173077668470990.jpg\" class=\"aligncenter\" title=\"MySQL\u7d22\u5f15\u652f\u6301\u54ea\u4e9b\u5b57\u6bb5\u7c7b\u578b\uff1f\u63d2\u56fe\" alt=\"MySQL\u7d22\u5f15\u652f\u6301\u54ea\u4e9b\u5b57\u6bb5\u7c7b\u578b\uff1f\u63d2\u56fe\" \/><\/p>\n<p><strong>\u7d22\u5f15\u652f\u6301\u5b57\u6bb5\u7c7b\u578b<\/strong><\/p>\n<p>\u5728mysql\u6570\u636e\u5e93\u4e2d\uff0c\u7d22\u5f15\u5bf9\u4e8e\u63d0\u9ad8\u67e5\u8be2\u6027\u80fd\u81f3\u5173\u91cd\u8981\u3002\u90a3\u4e48\uff0cmysql\u4e2d\u7684\u54ea\u4e9b\u5b57\u6bb5\u7c7b\u578b\u53ef\u4ee5\u88ab\u7d22\u5f15\u5462\uff1f<\/p>\n<p><strong>\u6240\u6709\u7c7b\u578b\u5747\u53ef\u7d22\u5f15<\/strong><\/p>\n<p>\u4e0e\u67d0\u4e9b\u6570\u636e\u5e93\u4e0d\u540c\uff0cmysql\u5141\u8bb8\u5bf9\u6240\u6709\u6570\u636e\u7c7b\u578b\u8fdb\u884c\u7d22\u5f15\uff0c\u5305\u62ec\uff1a<\/p>\n<ul>\n<li>int<\/li>\n<li>varchar<\/li>\n<li>char<\/li>\n<li>date<\/li>\n<li>txt<\/li>\n<li>double<\/li>\n<li>float<\/li>\n<li>decimale<\/li>\n<li>datetime<\/li>\n<\/ul>\n<p><strong>blob\u548ctext\u7c7b\u578b\u7684\u7279\u6b8a\u89c4\u5219<\/strong><\/p>\n<p>\u5bf9\u4e8eblob\u548ctext\u7c7b\u578b\u5b57\u6bb5\uff0c\u5728\u521b\u5efa\u7d22\u5f15\u65f6\u9700\u8981\u6307\u5b9a\u524d\u7f00\u957f\u5ea6\u3002\u4f8b\u5982\uff1a<\/p>\n<pre>CREATE TABLE test (blob_col BLOB, INDEX(blob_col(10)));<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u524d\u7f00\u957f\u5ea6\u53ef\u4ee5\u6307\u5b9a\u4e3a\u6700\u591a1000\u4e2a\u5b57\u8282\uff08\u5bf9\u4e8einnodb\u8868\u4e3a767\u4e2a\u5b57\u8282\uff0c\u9664\u975e\u8bbe\u7f6e\u4e86innodb_large_prefix\uff09\u3002<\/p>\n<p>\u4ee5\u4e0a\u5c31\u662fMySQL\u7d22\u5f15\u652f\u6301\u54ea\u4e9b\u5b57\u6bb5\u7c7b\u578b\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>\u7d22\u5f15\u652f\u6301\u5b57\u6bb5\u7c7b\u578b \u5728mysql\u6570\u636e\u5e93\u4e2d\uff0c\u7d22\u5f15\u5bf9\u4e8e\u63d0\u9ad8\u67e5\u8be2\u6027\u80fd\u81f3\u5173\u91cd\u8981\u3002\u90a3\u4e48\uff0cmysql\u4e2d\u7684\u54ea\u4e9b\u5b57\u6bb5\u7c7b\u578b\u53ef\u4ee5\u88ab\u7d22\u5f15\u5462\uff1f \u6240\u6709\u7c7b\u578b\u5747\u53ef\u7d22\u5f15 \u4e0e\u67d0\u4e9b\u6570\u636e\u5e93\u4e0d\u540c\uff0cmysql\u5141\u8bb8\u5bf9\u6240\u6709\u6570\u636e\u7c7b\u578b\u8fdb\u884c\u7d22\u5f15\uff0c\u5305\u62ec\uff1a int varchar char date txt double float decimale datetime blob\u548ctext\u7c7b\u578b\u7684\u7279\u6b8a\u89c4\u5219 \u5bf9\u4e8eblob\u548ctext\u7c7b\u578b\u5b57\u6bb5\uff0c\u5728\u521b\u5efa\u7d22\u5f15\u65f6\u9700\u8981\u6307\u5b9a\u524d\u7f00\u957f\u5ea6\u3002\u4f8b\u5982\uff1a CREATE TABLE test (blob_col BLOB, INDEX(blob_col(10))); \u767b\u5f55\u540e\u590d\u5236 \u524d\u7f00\u957f\u5ea6\u53ef\u4ee5\u6307\u5b9a\u4e3a\u6700\u591a1000\u4e2a\u5b57\u8282\uff08\u5bf9\u4e8einnodb\u8868\u4e3a767\u4e2a\u5b57\u8282\uff0c\u9664\u975e\u8bbe\u7f6e\u4e86innodb_large_prefix\uff09\u3002 \u4ee5\u4e0a\u5c31\u662fMySQL\u7d22\u5f15\u652f\u6301\u54ea\u4e9b\u5b57\u6bb5\u7c7b\u578b\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},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16],"tags":[],"class_list":["post-7391","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/7391","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=7391"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/7391\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=7391"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=7391"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=7391"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}