{"id":115107,"date":"2026-10-11T07:40:57","date_gmt":"2026-10-10T23:40:57","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/115107.html"},"modified":"2026-10-11T07:40:57","modified_gmt":"2026-10-10T23:40:57","slug":"mysql%e7%b4%a2%e5%bc%95%e5%a4%b1%e6%95%88%e7%9a%84%e5%9c%ba%e6%99%af%e6%80%bb%e7%bb%93","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/115107.html","title":{"rendered":"MySQL\u7d22\u5f15\u5931\u6548\u7684\u573a\u666f\u603b\u7ed3"},"content":{"rendered":"<p>\u4e0a\u4e00\u7bc7\u8bb2\u6267\u884c\u5668\u7684\u65f6\u5019\u8bf4\u8fc7&#xff0c;\u6709\u6ca1\u6709\u7d22\u5f15&#xff0c;\u51b3\u5b9a\u4e86\u6267\u884c\u5668\u662f&#034;\u4e00\u884c\u884c\u53d6\u56de\u6765\u81ea\u5df1\u5224\u65ad&#034;\u8fd8\u662f&#034;\u8ba9\u5f15\u64ce\u76f4\u63a5\u5b9a\u4f4d\u5230\u76ee\u6807\u884c&#034;\u3002\u7d22\u5f15\u80fd\u8d77\u4f5c\u7528\u7684\u524d\u63d0\u53ea\u6709\u4e00\u6761&#xff1a;\u6761\u4ef6\u80fd\u62ff\u6765\u5b9a\u4f4d\u3002<\/p>\n<p>InnoDB \u7684\u7d22\u5f15\u662f\u4e00\u68f5\u6309\u5217\u503c\u6392\u597d\u5e8f\u7684 B&#043; \u6811&#xff0c;\u9760\u7684\u5c31\u662f\u8fd9\u4e2a\u987a\u5e8f\u53bb\u7f29\u5c0f\u67e5\u627e\u8303\u56f4\u3002\u53ea\u8981\u5199\u6cd5\u7834\u574f\u4e86\u8fd9\u4e2a\u987a\u5e8f&#xff0c;\u6216\u8005\u8ba9\u67d0\u4e00\u5217\u7684\u503c\u6ca1\u6cd5\u6309\u539f\u6837\u6bd4\u8f83&#xff0c;\u7d22\u5f15\u5c31\u5b9a\u4f4d\u4e0d\u4e86&#xff0c;\u53ea\u80fd\u9000\u56de\u5168\u8868\u626b\u63cf\u3002\u53e6\u5916\u8fd8\u6709\u4e00\u7c7b\u60c5\u51b5\u662f\u6761\u4ef6\u672c\u8eab\u6ca1\u95ee\u9898&#xff0c;\u4f46\u4f18\u5316\u5668\u7b97\u4e0b\u6765\u89c9\u5f97\u5168\u8868\u626b\u66f4\u4fbf\u5b9c&#xff0c;\u4e3b\u52a8\u4e0d\u7528\u7d22\u5f15\u3002\u8fd9\u7bc7\u6211\u4eec\u628a\u8fd9\u4e24\u7c7b\u90fd\u6574\u7406\u4e00\u904d\u3002<\/p>\n<hr \/>\n<h2>\u7d22\u5f15\u5217\u88ab\u52a0\u5de5\u4e86<\/h2>\n<h3>\u7528\u51fd\u6570\u6216\u8fd0\u7b97\u5305\u4f4f\u7d22\u5f15\u5217<\/h3>\n<p><span class=\"token comment\">&#8212; \u5931\u6548&#xff1a;\u6761\u4ef6\u5217\u88ab date() \u5305\u4f4f<\/span><br \/>\n<span class=\"token keyword\">select<\/span> <span class=\"token operator\">*<\/span> <span class=\"token keyword\">from<\/span> t <span class=\"token keyword\">where<\/span> <span class=\"token keyword\">date<\/span><span class=\"token punctuation\">(<\/span>created_at<span class=\"token punctuation\">)<\/span> <span class=\"token operator\">&#061;<\/span> <span class=\"token string\">&#039;2024-01-01&#039;<\/span><span class=\"token punctuation\">;<\/span><\/p>\n<p><span class=\"token comment\">&#8212; \u5931\u6548&#xff1a;\u6761\u4ef6\u5217\u505a\u4e86\u8fd0\u7b97<\/span><br \/>\n<span class=\"token keyword\">select<\/span> <span class=\"token operator\">*<\/span> <span class=\"token keyword\">from<\/span> t <span class=\"token keyword\">where<\/span> id <span class=\"token operator\">&#043;<\/span> <span class=\"token number\">1<\/span> <span class=\"token operator\">&#061;<\/span> <span class=\"token number\">10<\/span><span class=\"token punctuation\">;<\/span><\/p>\n<p>\u7d22\u5f15\u6811\u91cc\u5b58\u7684\u662f created_at \u7684\u539f\u59cb\u503c&#xff0c;\u672c\u6765\u53ef\u4ee5\u6309\u539f\u503c\u76f4\u63a5\u5b9a\u4f4d\u3002\u5957\u4e0a date() \u4e4b\u540e&#xff0c;\u5f97\u628a\u6bcf\u4e00\u884c\u7684\u503c\u90fd\u7b97\u4e00\u904d\u624d\u77e5\u9053\u548c &#039;2024-01-01&#039; \u7b49\u4e0d\u7b49&#xff0c;\u6811\u4e0a\u7684\u987a\u5e8f\u5b8c\u5168\u7528\u4e0d\u4e0a\u3002<\/p>\n<p>\u6539\u5199\u65b9\u5411\u662f\u628a\u8fd0\u7b97\u632a\u5230\u7b49\u53f7\u53f3\u8fb9&#xff0c;\u8ba9\u6761\u4ef6\u5217\u4fdd\u6301&#034;\u5e72\u51c0&#034;&#xff1a;<\/p>\n<p><span class=\"token keyword\">select<\/span> <span class=\"token operator\">*<\/span> <span class=\"token keyword\">from<\/span> t <span class=\"token keyword\">where<\/span> created_at <span class=\"token operator\">&gt;&#061;<\/span> <span class=\"token string\">&#039;2024-01-01&#039;<\/span> <span class=\"token operator\">and<\/span> created_at <span class=\"token operator\">&lt;<\/span> <span class=\"token string\">&#039;2024-01-02&#039;<\/span><span class=\"token punctuation\">;<\/span><br \/>\n<span class=\"token keyword\">select<\/span> <span class=\"token operator\">*<\/span> <span class=\"token keyword\">from<\/span> t <span class=\"token keyword\">where<\/span> id <span class=\"token operator\">&#061;<\/span> <span class=\"token number\">9<\/span><span class=\"token punctuation\">;<\/span><\/p>\n<h3>\u9690\u5f0f\u7c7b\u578b\u8f6c\u6362<\/h3>\n<p><span class=\"token comment\">&#8212; phone \u662f varchar \u7c7b\u578b<\/span><br \/>\n<span class=\"token keyword\">select<\/span> <span class=\"token operator\">*<\/span> <span class=\"token keyword\">from<\/span> t <span class=\"token keyword\">where<\/span> phone <span class=\"token operator\">&#061;<\/span> <span class=\"token number\">13800000000<\/span><span class=\"token punctuation\">;<\/span>   <span class=\"token comment\">&#8212; \u5931\u6548<\/span><\/p>\n<p>MySQL \u5728\u6bd4\u8f83\u5b57\u7b26\u4e32\u548c\u6570\u5b57\u65f6&#xff0c;\u4f1a\u628a\u5b57\u7b26\u4e32\u8f6c\u6210\u6570\u5b57\u3002\u8fd9\u91cc phone \u662f varchar&#xff0c;\u5c31\u53d8\u6210\u4e86 CAST(phone AS DOUBLE) &#061; 13800000000&#xff0c;\u7b49\u4e8e\u7ed9\u5217\u5957\u4e86\u4e00\u4e2a\u51fd\u6570&#xff0c;\u548c\u4e0a\u9762\u4e00\u79cd\u60c5\u51b5\u672c\u8d28\u76f8\u540c\u3002<\/p>\n<p>\u53cd\u8fc7\u6765\u7684\u65b9\u5411\u4e0d\u5f71\u54cd&#xff1a;<\/p>\n<p><span class=\"token comment\">&#8212; id \u662f int \u7c7b\u578b<\/span><br \/>\n<span class=\"token keyword\">select<\/span> <span class=\"token operator\">*<\/span> <span class=\"token keyword\">from<\/span> t <span class=\"token keyword\">where<\/span> id <span class=\"token operator\">&#061;<\/span> <span class=\"token string\">&#039;10&#039;<\/span><span class=\"token punctuation\">;<\/span>   <span class=\"token comment\">&#8212; \u4ecd\u8d70\u7d22\u5f15<\/span><\/p>\n<p>\u56e0\u4e3a\u5b57\u7b26\u4e32 &#039;10&#039; \u88ab\u8f6c\u6210\u6570\u5b57 10&#xff0c;\u7b49\u4ef7\u4e8e id &#061; 10&#xff0c;\u5217\u672c\u8eab\u6ca1\u88ab\u78b0\u3002\u6240\u4ee5\u89c4\u5f8b\u662f&#xff1a;\u5b57\u7b26\u4e32\u5217\u4f20\u6570\u5b57\u4f1a\u5931\u6548&#xff0c;\u6570\u5b57\u5217\u4f20\u5b57\u7b26\u4e32\u4e0d\u5f71\u54cd\u3002<\/p>\n<p>\u8fd9\u4e2a\u5751\u8fd8\u5e38\u51fa\u73b0\u5728 join \u4e0a&#xff1a;\u4e24\u5f20\u8868\u5173\u8054\u7684\u5b57\u6bb5\u4e00\u4e2a\u662f varchar\u3001\u4e00\u4e2a\u662f int&#xff0c;\u5173\u8054\u65f6\u540c\u6837\u4f1a\u89e6\u53d1\u8f6c\u6362&#xff0c;\u7d22\u5f15\u4e5f\u7528\u4e0d\u4e0a\u3002<\/p>\n<p>\u9700\u8981\u6ce8\u610f\u7684\u662f&#xff0c;\u9690\u5f0f\u8f6c\u6362\u4e0d\u62a5\u9519\u3001\u4e5f\u4e0d\u4f1a\u6709\u8b66\u544a&#xff0c;EXPLAIN \u91cc\u624d\u770b\u5f97\u51fa\u6765\u3002\u53c2\u6570\u7c7b\u578b\u548c\u5217\u7c7b\u578b\u4fdd\u6301\u4e00\u81f4&#xff0c;\u662f\u907f\u514d\u5b83\u7684\u552f\u4e00\u529e\u6cd5\u3002<\/p>\n<hr \/>\n<h2>\u6761\u4ef6\u7684\u987a\u5e8f\u7528\u4e0d\u4e0a\u7d22\u5f15<\/h2>\n<h3>\u8054\u5408\u7d22\u5f15\u4e0e\u6700\u5de6\u524d\u7f00<\/h3>\n<p>\u8054\u5408\u7d22\u5f15 (a, b, c) \u7684\u6392\u5e8f\u89c4\u5219\u662f&#xff1a;\u5148\u6309 a \u6392&#xff0c;a \u76f8\u540c\u518d\u6309 b \u6392&#xff0c;b \u76f8\u540c\u518d\u6309 c \u6392\u3002\u6240\u4ee5\u8981\u7528\u4e0a\u5b83&#xff0c;\u6761\u4ef6\u5fc5\u987b\u4ece\u6700\u5de6\u8fb9\u7684\u5217\u5f00\u59cb\u3001\u8fde\u7eed\u5730\u7528&#xff1a;<\/p>\n<table>\n<tr>\u6761\u4ef6\u7528\u5230\u7684\u7d22\u5f15\u5217<\/tr>\n<tbody>\n<tr>\n<td>where a &#061; 1<\/td>\n<td>a<\/td>\n<\/tr>\n<tr>\n<td>where a &#061; 1 and b &#061; 2<\/td>\n<td>a, b<\/td>\n<\/tr>\n<tr>\n<td>where a &#061; 1 and b &#061; 2 and c &#061; 3<\/td>\n<td>a, b, c<\/td>\n<\/tr>\n<tr>\n<td>where a &#061; 1 and c &#061; 3<\/td>\n<td>\u53ea\u6709 a&#xff0c;c \u7528\u4e0d\u4e0a<\/td>\n<\/tr>\n<tr>\n<td>where b &#061; 2<\/td>\n<td>\u7528\u4e0d\u4e0a<\/td>\n<\/tr>\n<tr>\n<td>where c &#061; 3<\/td>\n<td>\u7528\u4e0d\u4e0a<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u539f\u56e0\u8fd8\u662f\u90a3\u4e2a\u987a\u5e8f&#xff1a;\u8df3\u8fc7 a \u5c31\u6ca1\u6cd5\u5b9a\u4f4d&#xff0c;b\u3001c \u5355\u72ec\u7684\u6392\u5e8f\u5728\u6574\u68f5\u6811\u91cc\u662f\u4e71\u7684\u3002<\/p>\n<p>\u6ce8\u610f\u6761\u4ef6\u7684\u4e66\u5199\u987a\u5e8f\u65e0\u6240\u8c13&#xff0c;\u4f18\u5316\u5668\u4f1a\u81ea\u52a8\u8c03\u6574\u6210\u6700\u5de6\u524d\u7f00\u7684\u987a\u5e8f&#xff0c;where b &#061; 2 and a &#061; 1 \u548c where a &#061; 1 and b &#061; 2 \u6548\u679c\u4e00\u6837\u3002\u5173\u952e\u662f\u7528\u5230\u7684\u662f\u4e0d\u662f\u6700\u5de6\u8fb9\u90a3\u8fde\u7eed\u51e0\u5217\u3002<\/p>\n<p>\u53e6\u5916&#xff0c;MySQL 8.0 \u5f15\u5165\u4e86 skip scan&#xff0c;\u5728 a \u7684\u53d6\u503c\u79cd\u7c7b\u5f88\u5c11&#xff08;\u533a\u5206\u5ea6\u6781\u4f4e&#xff09;\u65f6&#xff0c;\u4f1a\u5c1d\u8bd5\u8df3\u8fc7 a \u76f4\u63a5\u6309 b \u627e\u3002\u8fd9\u662f\u7279\u5b9a\u6761\u4ef6\u4e0b\u7684\u7279\u4f8b&#xff0c;\u4e0d\u80fd\u4f9d\u8d56\u3002<\/p>\n<h3>\u8303\u56f4\u6761\u4ef6\u4e4b\u540e\u7684\u5217<\/h3>\n<p><span class=\"token comment\">&#8212; \u7d22\u5f15 (a, b, c)<\/span><br \/>\n<span class=\"token keyword\">select<\/span> <span class=\"token operator\">*<\/span> <span class=\"token keyword\">from<\/span> t <span class=\"token keyword\">where<\/span> a <span class=\"token operator\">&#061;<\/span> <span class=\"token number\">1<\/span> <span class=\"token operator\">and<\/span> b <span class=\"token operator\">&gt;<\/span> <span class=\"token number\">2<\/span> <span class=\"token operator\">and<\/span> c <span class=\"token operator\">&#061;<\/span> <span class=\"token number\">3<\/span><span class=\"token punctuation\">;<\/span>   <span class=\"token comment\">&#8212; c \u7528\u4e0d\u4e0a<\/span><\/p>\n<p>a \u548c b \u80fd\u7528\u4e0a&#xff08;b \u662f\u8303\u56f4\u67e5\u8be2&#xff09;&#xff0c;\u4f46 c \u7528\u4e0d\u4e0a\u3002\u56e0\u4e3a b \u4e00\u65e6\u662f\u8303\u56f4&#xff0c;\u5728 b \u547d\u4e2d\u7684\u8fd9\u4e00\u6bb5\u91cc&#xff0c;c \u5df2\u7ecf\u4e0d\u518d\u6709\u5e8f\u4e86&#xff0c;\u6ca1\u6cd5\u518d\u62ff\u5b83\u53bb\u5b9a\u4f4d\u3002<\/p>\n<p>\u6240\u4ee5\u6211\u4eec\u6392\u8054\u5408\u7d22\u5f15\u7684\u5217\u987a\u5e8f\u65f6&#xff0c;\u7b49\u503c\u67e5\u8be2\u7684\u5217\u653e\u524d\u9762&#xff0c;\u8303\u56f4\u67e5\u8be2\u7684\u5217\u653e\u540e\u9762\u3002<\/p>\n<h3>like \u4ee5 % \u5f00\u5934<\/h3>\n<p><span class=\"token keyword\">select<\/span> <span class=\"token operator\">*<\/span> <span class=\"token keyword\">from<\/span> t <span class=\"token keyword\">where<\/span> name <span class=\"token operator\">like<\/span> <span class=\"token string\">&#039;%abc&#039;<\/span><span class=\"token punctuation\">;<\/span>    <span class=\"token comment\">&#8212; \u5931\u6548<\/span><br \/>\n<span class=\"token keyword\">select<\/span> <span class=\"token operator\">*<\/span> <span class=\"token keyword\">from<\/span> t <span class=\"token keyword\">where<\/span> name <span class=\"token operator\">like<\/span> <span class=\"token string\">&#039;%abc%&#039;<\/span><span class=\"token punctuation\">;<\/span>   <span class=\"token comment\">&#8212; \u5931\u6548<\/span><br \/>\n<span class=\"token keyword\">select<\/span> <span class=\"token operator\">*<\/span> <span class=\"token keyword\">from<\/span> t <span class=\"token keyword\">where<\/span> name <span class=\"token operator\">like<\/span> <span class=\"token string\">&#039;abc%&#039;<\/span><span class=\"token punctuation\">;<\/span>    <span class=\"token comment\">&#8212; \u6709\u6548<\/span><\/p>\n<p>abc% \u662f\u524d\u7f00\u786e\u5b9a&#xff0c;\u80fd\u5728\u6709\u5e8f\u7684\u6811\u91cc\u5b9a\u4f4d\u5230 abc \u5f00\u5934\u7684\u533a\u95f4\u3002\u4e00\u65e6 % \u8dd1\u5230\u524d\u9762&#xff0c;\u524d\u7f00\u5c31\u4e0d\u5b9a\u4e86&#xff0c;\u53ea\u80fd\u6328\u4e2a\u6bd4\u8f83\u3002\u5fc5\u987b\u505a\u4e2d\u95f4\u5339\u914d\u7684\u8bdd&#xff0c;\u5f97\u6362\u6210\u5168\u6587\u7d22\u5f15\u6216\u8005\u4e13\u95e8\u7684\u641c\u7d22\u5f15\u64ce&#xff0c;\u666e\u901a B&#043; \u6811\u7d22\u5f15\u5e2e\u4e0d\u4e0a\u5fd9\u3002<\/p>\n<hr \/>\n<h2>\u9009\u62e9\u6027\u5dee&#xff0c;\u4f18\u5316\u5668\u4e3b\u52a8\u653e\u5f03<\/h2>\n<p>\u524d\u9762\u7684\u60c5\u51b5\u662f&#034;\u6761\u4ef6\u6ca1\u6cd5\u5b9a\u4f4d&#034;&#xff0c;\u8fd9\u4e00\u7c7b\u4e0d\u592a\u4e00\u6837&#xff1a;\u6761\u4ef6\u5199\u6cd5\u662f\u5bf9\u7684&#xff0c;\u7d22\u5f15\u4e5f\u80fd\u7528&#xff0c;\u4f46\u4f18\u5316\u5668\u7b97\u4e86\u4e00\u7b14\u8d26&#xff0c;\u89c9\u5f97\u8d70\u7d22\u5f15\u66f4\u4e8f&#xff0c;\u4e8e\u662f\u4e3b\u52a8\u653e\u5f03\u3002<\/p>\n<h3>or \u4e24\u8fb9\u4e0d\u90fd\u6709\u7d22\u5f15<\/h3>\n<p><span class=\"token comment\">&#8212; a \u6709\u7d22\u5f15&#xff0c;b \u6ca1\u6709<\/span><br \/>\n<span class=\"token keyword\">select<\/span> <span class=\"token operator\">*<\/span> <span class=\"token keyword\">from<\/span> t <span class=\"token keyword\">where<\/span> a <span class=\"token operator\">&#061;<\/span> <span class=\"token number\">1<\/span> <span class=\"token operator\">or<\/span> b <span class=\"token operator\">&#061;<\/span> <span class=\"token number\">2<\/span><span class=\"token punctuation\">;<\/span><\/p>\n<p>or \u7684\u542b\u4e49\u662f&#034;\u6ee1\u8db3\u4efb\u610f\u4e00\u4e2a\u5373\u53ef&#034;&#xff0c;\u8981\u62ff\u5230\u5b8c\u6574\u7ed3\u679c&#xff0c;b &#061; 2 \u90a3\u90e8\u5206\u4e5f\u5f97\u67e5\u4e00\u904d\u3002\u65e2\u7136 b \u4e0a\u6ca1\u6709\u7d22\u5f15&#xff0c;\u7d22\u6027\u6574\u6761\u8bed\u53e5\u5168\u8868\u626b\u63cf\u3002<\/p>\n<p>\u5982\u679c a\u3001b \u4e0a\u90fd\u6709\u7d22\u5f15&#xff0c;MySQL \u53ef\u80fd\u4f1a\u7528 index merge&#xff0c;\u5206\u522b\u8d70\u4e24\u4e2a\u7d22\u5f15\u518d\u5408\u5e76\u7ed3\u679c&#xff0c;EXPLAIN \u91cc type \u4f1a\u663e\u793a index_merge\u3002\u6539\u5199\u65b9\u5f0f\u662f\u628a\u4e24\u4e2a\u6761\u4ef6\u62c6\u5f00\u7528 union&#xff0c;\u6216\u8005\u7ed9\u7f3a\u7d22\u5f15\u7684\u90a3\u5217\u4e5f\u8865\u4e0a\u7d22\u5f15\u3002<\/p>\n<h3>\u5426\u5b9a\u6761\u4ef6<\/h3>\n<p><span class=\"token keyword\">select<\/span> <span class=\"token operator\">*<\/span> <span class=\"token keyword\">from<\/span> t <span class=\"token keyword\">where<\/span> name <span class=\"token operator\">!&#061;<\/span> <span class=\"token string\">&#039;zs&#039;<\/span><span class=\"token punctuation\">;<\/span><br \/>\n<span class=\"token keyword\">select<\/span> <span class=\"token operator\">*<\/span> <span class=\"token keyword\">from<\/span> t <span class=\"token keyword\">where<\/span> id <span class=\"token operator\">not<\/span> <span class=\"token operator\">in<\/span> <span class=\"token punctuation\">(<\/span><span class=\"token number\">1<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token number\">2<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token number\">3<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><\/p>\n<p>!&#061;\u3001&lt;&gt;\u3001not in\u3001not exists \u8fd9\u4e9b\u662f&#034;\u6392\u9664\u5f0f&#034;\u7684\u6761\u4ef6&#xff0c;\u6ee1\u8db3\u6761\u4ef6\u7684\u884c\u53ef\u80fd\u5360\u5168\u8868\u7684\u4e00\u5927\u534a\u3002\u8d70\u7d22\u5f15\u610f\u5473\u7740\u5148\u626b\u7d22\u5f15\u3001\u518d\u56de\u8868&#xff0c;\u56de\u8868\u7684\u884c\u6570\u4e00\u591a&#xff0c;\u8fd8\u4e0d\u5982\u76f4\u63a5\u987a\u5e8f\u626b\u5168\u8868\u3002\u6240\u4ee5\u4f18\u5316\u5668\u901a\u5e38\u653e\u5f03\u7d22\u5f15\u2014\u2014\u4f46\u6ce8\u610f\u8fd9\u662f&#034;\u901a\u5e38&#034;&#xff0c;\u4e0d\u662f\u7edd\u5bf9&#xff0c;\u9009\u62e9\u6027\u9ad8\u7684\u5426\u5b9a\u6761\u4ef6\u4ecd\u6709\u53ef\u80fd\u8d70\u7d22\u5f15\u3002<\/p>\n<h3>IS NULL \u5230\u5e95\u8d70\u4e0d\u8d70<\/h3>\n<p>\u8fd9\u91cc\u6211\u4eec\u5355\u72ec\u8bf4\u4e00\u6761&#xff0c;\u56e0\u4e3a\u6d41\u4f20\u7684\u8bf4\u6cd5\u6709\u95ee\u9898&#xff1a;&#034;\u7d22\u5f15\u4e0d\u5b58 NULL \u503c&#xff0c;\u6240\u4ee5 IS NULL \u4e0d\u8d70\u7d22\u5f15&#034;\u662f\u9519\u7684\u3002InnoDB \u7684\u4e8c\u7ea7\u7d22\u5f15\u662f\u5b58 NULL \u503c\u7684&#xff0c;MySQL \u5b98\u65b9\u624b\u518c\u91cc\u4e5f\u5199\u660e\u4e86 IS NULL \u53ef\u4ee5\u7528\u7d22\u5f15\u548c\u533a\u95f4\u67e5\u627e\u3002<\/p>\n<p><span class=\"token keyword\">select<\/span> <span class=\"token operator\">*<\/span> <span class=\"token keyword\">from<\/span> t <span class=\"token keyword\">where<\/span> address <span class=\"token operator\">is<\/span> <span class=\"token boolean\">null<\/span><span class=\"token punctuation\">;<\/span>      <span class=\"token comment\">&#8212; \u53ef\u4ee5\u7528\u7d22\u5f15<\/span><br \/>\n<span class=\"token keyword\">select<\/span> <span class=\"token operator\">*<\/span> <span class=\"token keyword\">from<\/span> t <span class=\"token keyword\">where<\/span> address <span class=\"token operator\">is<\/span> <span class=\"token operator\">not<\/span> <span class=\"token boolean\">null<\/span><span class=\"token punctuation\">;<\/span>  <span class=\"token comment\">&#8212; \u4e5f\u53ef\u4ee5\u7528&#xff0c;\u4f46\u770b\u6570\u636e\u5206\u5e03<\/span><\/p>\n<p>\u5177\u4f53\u8d70\u4e0d\u8d70&#xff0c;\u8fd8\u662f\u56de\u5230\u4f18\u5316\u5668\u90a3\u7b14\u8d26&#xff1a;\u7b26\u5408\u6761\u4ef6\u7684\u884c\u5c11&#xff0c;\u5c31\u7528\u7d22\u5f15&#xff1b;\u5360\u4e86\u5927\u534a\u5f20\u8868&#xff0c;\u5c31\u5168\u8868\u626b\u3002\u7f51\u4e0a\u90a3\u6761\u53e3\u8bc0\u5728 InnoDB \u91cc\u4e0d\u6210\u7acb&#xff0c;\u522b\u80cc\u3002<\/p>\n<h3>\u4f18\u5316\u5668\u5224\u65ad\u5168\u8868\u66f4\u5212\u7b97<\/h3>\n<p>\u9664\u4e86\u4e0a\u9762\u51e0\u79cd&#xff0c;\u8fd8\u6709\u51e0\u79cd\u5e38\u89c1\u60c5\u5f62\u4f1a\u8ba9\u4f18\u5316\u5668\u76f4\u63a5\u9009\u5168\u8868\u626b\u63cf&#xff1a;<\/p>\n<table>\n<tr>\u60c5\u5f62\u539f\u56e0<\/tr>\n<tbody>\n<tr>\n<td>\u8868\u672c\u8eab\u5f88\u5c0f<\/td>\n<td>\u8d70\u7d22\u5f15\u8981\u5148\u67e5\u7d22\u5f15\u518d\u56de\u8868&#xff0c;\u6bd4\u987a\u5e8f\u626b\u5168\u8868\u8fd8\u6162<\/td>\n<\/tr>\n<tr>\n<td>\u5217\u7684\u533a\u5206\u5ea6\u4f4e&#xff08;\u5982\u6027\u522b&#xff09;<\/td>\n<td>\u51e0\u4e4e\u6bcf\u884c\u90fd\u8981\u8bfb&#xff0c;\u7d22\u5f15\u6ca1\u8d77\u5230\u8fc7\u6ee4\u4f5c\u7528<\/td>\n<\/tr>\n<tr>\n<td>\u67e5\u7684\u5217\u591a\u3001\u547d\u4e2d\u884c\u591a<\/td>\n<td>\u6bcf\u884c\u90fd\u8981\u56de\u8868&#xff0c;\u968f\u673a IO&#xff0c;\u4e0d\u5982\u987a\u5e8f\u626b<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u7b2c\u4e09\u70b9\u91cc\u6700\u5e38\u89c1\u7684\u8bf1\u56e0\u662f select *\u3002\u5982\u679c\u67e5\u8be2\u7528\u5230\u7684\u5217\u6070\u597d\u90fd\u5728\u7d22\u5f15\u91cc&#xff08;\u8986\u76d6\u7d22\u5f15&#xff09;&#xff0c;\u5c31\u7701\u6389\u4e86\u56de\u8868&#xff0c;\u4f18\u5316\u5668\u5f80\u5f80\u5c31\u613f\u610f\u8d70\u7d22\u5f15\u4e86\u3002\u524d\u9762\u4e00\u6761 SQL \u90a3\u7bc7\u91cc\u8bb2\u56de\u8868 \u7684\u65f6\u5019\u63d0\u8fc7\u8fd9\u4e00\u70b9\u3002<\/p>\n<hr \/>\n<h2>\u600e\u4e48\u786e\u8ba4\u5230\u5e95\u8d70\u6ca1\u8d70<\/h2>\n<p>\u4e0a\u9762\u5f88\u591a&#034;\u5931\u6548&#034;\u5f52\u6839\u5230\u5e95\u662f\u4f18\u5316\u5668\u7684\u53d6\u820d&#xff0c;\u5149\u770b SQL \u731c\u4e0d\u51c6&#xff0c;\u6211\u4eec\u76f4\u63a5\u770b\u6267\u884c\u8ba1\u5212&#xff1a;<\/p>\n<p><span class=\"token keyword\">explain<\/span> <span class=\"token keyword\">select<\/span> <span class=\"token operator\">*<\/span> <span class=\"token keyword\">from<\/span> t <span class=\"token keyword\">where<\/span> a <span class=\"token operator\">&#061;<\/span> <span class=\"token number\">1<\/span> <span class=\"token operator\">and<\/span> b <span class=\"token operator\">&gt;<\/span> <span class=\"token number\">2<\/span><span class=\"token punctuation\">;<\/span><\/p>\n<p>\u91cd\u70b9\u770b\u4e09\u5217&#xff1a;<\/p>\n<table>\n<tr>\u5217\u770b\u4ec0\u4e48<\/tr>\n<tbody>\n<tr>\n<td>type<\/td>\n<td>\u8bbf\u95ee\u65b9\u5f0f&#xff0c;ALL \u5c31\u662f\u5168\u8868\u626b\u63cf&#xff1b;range\u3001ref\u3001eq_ref\u3001const \u662f\u7531\u5dee\u5230\u597d<\/td>\n<\/tr>\n<tr>\n<td>key<\/td>\n<td>\u5b9e\u9645\u7528\u5230\u7684\u7d22\u5f15&#xff0c;NULL \u8868\u793a\u6ca1\u8d70\u7d22\u5f15<\/td>\n<\/tr>\n<tr>\n<td>rows<\/td>\n<td>\u9884\u4f30\u8981\u626b\u63cf\u7684\u884c\u6570&#xff0c;\u8d8a\u5c0f\u8d8a\u597d<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>type &#061; ALL \u6216\u8005 key &#061; NULL&#xff0c;\u5c31\u662f\u6ca1\u8d70\u7d22\u5f15\u3002\u8fd9\u4e2a\u5224\u65ad\u63a5\u7684\u5c31\u662f\u4e0a\u4e00\u7bc7\u91cc\u4f18\u5316\u5668\u8f93\u51fa\u7684\u90a3\u4efd\u6267\u884c\u8ba1\u5212\u3002<\/p>\n<p>\u5982\u679c\u786e\u8ba4\u4f18\u5316\u5668\u9009\u9519\u4e86\u7d22\u5f15&#xff08;\u7edf\u8ba1\u4fe1\u606f\u4e0d\u51c6\u5bfc\u81f4\u7684&#xff09;&#xff0c;\u53ef\u4ee5\u7528 analyze table \u91cd\u65b0\u6536\u96c6\u7edf\u8ba1\u4fe1\u606f&#xff0c;\u6216\u8005\u7528 force index \u5f3a\u5236\u6307\u5b9a&#xff0c;\u4f46\u540e\u8005\u5c5e\u4e8e\u6253\u8865\u4e01&#xff0c;\u5148\u60f3\u6e05\u695a\u4f18\u5316\u5668\u4e3a\u4ec0\u4e48\u4e0d\u7528\u5b83\u3002<\/p>\n<hr \/>\n<h2>\u901f\u67e5\u8868<\/h2>\n<table>\n<tr>\u573a\u666f\u4f8b\u5b50\u4e3a\u4ec0\u4e48\u5931\u6548<\/tr>\n<tbody>\n<tr>\n<td>\u5217\u4e0a\u6709\u51fd\u6570<\/td>\n<td>where date(t) &#061; &#039;2024-01-01&#039;<\/td>\n<td>\u7d22\u5f15\u5b58\u7684\u662f\u539f\u503c&#xff0c;\u7b97\u8fc7\u7684\u503c\u6ca1\u6cd5\u5b9a\u4f4d<\/td>\n<\/tr>\n<tr>\n<td>\u5217\u4e0a\u6709\u8fd0\u7b97<\/td>\n<td>where id &#043; 1 &#061; 10<\/td>\n<td>\u540c\u4e0a<\/td>\n<\/tr>\n<tr>\n<td>\u9690\u5f0f\u7c7b\u578b\u8f6c\u6362<\/td>\n<td>varchar \u5217 &#061; 13800000000<\/td>\n<td>\u5217\u88ab\u9690\u5f0f\u8f6c\u6210\u6570\u5b57&#xff0c;\u76f8\u5f53\u4e8e\u5957\u4e86\u51fd\u6570<\/td>\n<\/tr>\n<tr>\n<td>\u4e0d\u6ee1\u8db3\u6700\u5de6\u524d\u7f00<\/td>\n<td>\u7d22\u5f15 (a,b)&#xff0c;where b &#061; 1<\/td>\n<td>\u8df3\u8fc7\u4e86\u6392\u5e8f\u7684\u7b2c\u4e00\u5217<\/td>\n<\/tr>\n<tr>\n<td>\u8303\u56f4\u4e4b\u540e\u7684\u5217<\/td>\n<td>a&#061;1 and b&gt;2 and c&#061;3<\/td>\n<td>\u8303\u56f4\u5185 c \u4e0d\u518d\u6709\u5e8f<\/td>\n<\/tr>\n<tr>\n<td>\u524d\u5bfc\u6a21\u7cca<\/td>\n<td>like &#039;%abc&#039;<\/td>\n<td>\u524d\u7f00\u4e0d\u5b9a&#xff0c;\u6ca1\u6cd5\u5b9a\u4f4d\u533a\u95f4<\/td>\n<\/tr>\n<tr>\n<td>or \u4e00\u4fa7\u65e0\u7d22\u5f15<\/td>\n<td>a &#061; 1 or b &#061; 2<\/td>\n<td>\u53e6\u4e00\u4fa7\u5f97\u5168\u8868\u626b&#xff0c;\u7d22\u6027\u6574\u4f53\u5168\u8868<\/td>\n<\/tr>\n<tr>\n<td>\u5426\u5b9a\u6761\u4ef6<\/td>\n<td>!&#061;\u3001not in<\/td>\n<td>\u547d\u4e2d\u884c\u6bd4\u4f8b\u9ad8&#xff0c;\u56de\u8868\u4e0d\u5212\u7b97<\/td>\n<\/tr>\n<tr>\n<td>\u533a\u5206\u5ea6\u4f4e \/ \u8868\u5c0f<\/td>\n<td>\u6027\u522b\u5217\u3001\u5c0f\u8868<\/td>\n<td>\u8d70\u7d22\u5f15\u4e0d\u5212\u7b97&#xff0c;\u4f18\u5316\u5668\u4e3b\u52a8\u653e\u5f03<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n","protected":false},"excerpt":{"rendered":"<p>\u4e0a\u4e00\u7bc7\u8bb2\u6267\u884c\u5668\u7684\u65f6\u5019\u8bf4\u8fc7&#xff0c;\u6709\u6ca1\u6709\u7d22\u5f15&#xff0c;\u51b3\u5b9a\u4e86\u6267\u884c\u5668\u662f\\&#8221;\u4e00\u884c\u884c\u53d6\u56de\u6765\u81ea\u5df1\u5224\u65ad\\&#8221;\u8fd8\u662f\\&#8221;\u8ba9\u5f15\u64ce\u76f4\u63a5\u5b9a\u4f4d\u5230\u76ee\u6807\u884c\\&#8221;\u3002\u7d22\u5f15\u80fd\u8d77\u4f5c\u7528\u7684\u524d\u63d0\u53ea\u6709\u4e00\u6761&#xff1a;\u6761\u4ef6\u80fd\u62ff\u6765\u5b9a\u4f4d\u3002<br \/>\nInnoDB \u7684\u7d22\u5f15\u662f\u4e00\u68f5\u6309\u5217\u503c\u6392\u597d\u5e8f\u7684 B \u6811&#xff0c;\u9760\u7684\u5c31\u662f\u8fd9\u4e2a\u987a\u5e8f\u53bb\u7f29\u5c0f\u67e5\u627e\u8303\u56f4\u3002\u53ea\u8981\u5199\u6cd5\u7834\u574f\u4e86\u8fd9\u4e2a\u987a\u5e8f&#xff0c;\u6216\u8005\u8ba9\u67d0\u4e00\u5217\u7684\u503c\u6ca1\u6cd5\u6309\u539f\u6837\u6bd4\u8f83&#xff0c;\u7d22\u5f15\u5c31\u5b9a\u4f4d\u4e0d\u4e86&#xff0c;\u53ea\u80fd\u9000\u56de\u5168\u8868\u626b\u63cf\u3002\u53e6\u5916\u8fd8\u6709\u4e00\u7c7b\u60c5\u51b5\u662f\u6761\u4ef6\u672c\u8eab\u6ca1\u95ee\u9898&#xff0c;\u4f46\u4f18\u5316\u5668<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[114,100],"topic":[],"class_list":["post-115107","post","type-post","status-publish","format-standard","hentry","category-server","tag-mysql","tag-100"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>MySQL\u7d22\u5f15\u5931\u6548\u7684\u573a\u666f\u603b\u7ed3 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/115107.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"MySQL\u7d22\u5f15\u5931\u6548\u7684\u573a\u666f\u603b\u7ed3 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u4e0a\u4e00\u7bc7\u8bb2\u6267\u884c\u5668\u7684\u65f6\u5019\u8bf4\u8fc7&#xff0c;\u6709\u6ca1\u6709\u7d22\u5f15&#xff0c;\u51b3\u5b9a\u4e86\u6267\u884c\u5668\u662f&quot;\u4e00\u884c\u884c\u53d6\u56de\u6765\u81ea\u5df1\u5224\u65ad&quot;\u8fd8\u662f&quot;\u8ba9\u5f15\u64ce\u76f4\u63a5\u5b9a\u4f4d\u5230\u76ee\u6807\u884c&quot;\u3002\u7d22\u5f15\u80fd\u8d77\u4f5c\u7528\u7684\u524d\u63d0\u53ea\u6709\u4e00\u6761&#xff1a;\u6761\u4ef6\u80fd\u62ff\u6765\u5b9a\u4f4d\u3002 InnoDB \u7684\u7d22\u5f15\u662f\u4e00\u68f5\u6309\u5217\u503c\u6392\u597d\u5e8f\u7684 B \u6811&#xff0c;\u9760\u7684\u5c31\u662f\u8fd9\u4e2a\u987a\u5e8f\u53bb\u7f29\u5c0f\u67e5\u627e\u8303\u56f4\u3002\u53ea\u8981\u5199\u6cd5\u7834\u574f\u4e86\u8fd9\u4e2a\u987a\u5e8f&#xff0c;\u6216\u8005\u8ba9\u67d0\u4e00\u5217\u7684\u503c\u6ca1\u6cd5\u6309\u539f\u6837\u6bd4\u8f83&#xff0c;\u7d22\u5f15\u5c31\u5b9a\u4f4d\u4e0d\u4e86&#xff0c;\u53ea\u80fd\u9000\u56de\u5168\u8868\u626b\u63cf\u3002\u53e6\u5916\u8fd8\u6709\u4e00\u7c7b\u60c5\u51b5\u662f\u6761\u4ef6\u672c\u8eab\u6ca1\u95ee\u9898&#xff0c;\u4f46\u4f18\u5316\u5668\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/115107.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-10-10T23:40:57+00:00\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/115107.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/115107.html\",\"name\":\"MySQL\u7d22\u5f15\u5931\u6548\u7684\u573a\u666f\u603b\u7ed3 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-10-10T23:40:57+00:00\",\"dateModified\":\"2026-10-10T23:40:57+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/115107.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/115107.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/115107.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"MySQL\u7d22\u5f15\u5931\u6548\u7684\u573a\u666f\u603b\u7ed3\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"MySQL\u7d22\u5f15\u5931\u6548\u7684\u573a\u666f\u603b\u7ed3 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/115107.html","og_locale":"zh_CN","og_type":"article","og_title":"MySQL\u7d22\u5f15\u5931\u6548\u7684\u573a\u666f\u603b\u7ed3 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u4e0a\u4e00\u7bc7\u8bb2\u6267\u884c\u5668\u7684\u65f6\u5019\u8bf4\u8fc7&#xff0c;\u6709\u6ca1\u6709\u7d22\u5f15&#xff0c;\u51b3\u5b9a\u4e86\u6267\u884c\u5668\u662f\"\u4e00\u884c\u884c\u53d6\u56de\u6765\u81ea\u5df1\u5224\u65ad\"\u8fd8\u662f\"\u8ba9\u5f15\u64ce\u76f4\u63a5\u5b9a\u4f4d\u5230\u76ee\u6807\u884c\"\u3002\u7d22\u5f15\u80fd\u8d77\u4f5c\u7528\u7684\u524d\u63d0\u53ea\u6709\u4e00\u6761&#xff1a;\u6761\u4ef6\u80fd\u62ff\u6765\u5b9a\u4f4d\u3002 InnoDB \u7684\u7d22\u5f15\u662f\u4e00\u68f5\u6309\u5217\u503c\u6392\u597d\u5e8f\u7684 B \u6811&#xff0c;\u9760\u7684\u5c31\u662f\u8fd9\u4e2a\u987a\u5e8f\u53bb\u7f29\u5c0f\u67e5\u627e\u8303\u56f4\u3002\u53ea\u8981\u5199\u6cd5\u7834\u574f\u4e86\u8fd9\u4e2a\u987a\u5e8f&#xff0c;\u6216\u8005\u8ba9\u67d0\u4e00\u5217\u7684\u503c\u6ca1\u6cd5\u6309\u539f\u6837\u6bd4\u8f83&#xff0c;\u7d22\u5f15\u5c31\u5b9a\u4f4d\u4e0d\u4e86&#xff0c;\u53ea\u80fd\u9000\u56de\u5168\u8868\u626b\u63cf\u3002\u53e6\u5916\u8fd8\u6709\u4e00\u7c7b\u60c5\u51b5\u662f\u6761\u4ef6\u672c\u8eab\u6ca1\u95ee\u9898&#xff0c;\u4f46\u4f18\u5316\u5668","og_url":"https:\/\/www.wsisp.com\/helps\/115107.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-10-10T23:40:57+00:00","author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"3 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/115107.html","url":"https:\/\/www.wsisp.com\/helps\/115107.html","name":"MySQL\u7d22\u5f15\u5931\u6548\u7684\u573a\u666f\u603b\u7ed3 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-10-10T23:40:57+00:00","dateModified":"2026-10-10T23:40:57+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/115107.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/115107.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/115107.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"MySQL\u7d22\u5f15\u5931\u6548\u7684\u573a\u666f\u603b\u7ed3"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/115107","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=115107"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/115107\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=115107"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=115107"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=115107"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=115107"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}