{"id":286,"date":"2009-11-26T11:16:05","date_gmt":"2009-11-26T03:16:05","guid":{"rendered":"http:\/\/gwokae.myftp.org\/wordpress\/?p=286"},"modified":"2009-11-26T11:16:05","modified_gmt":"2009-11-26T03:16:05","slug":"mysql-%e8%b3%87%e6%96%99%e8%a1%a8%e3%80%81%e8%b3%87%e6%96%99%e5%ba%ab%e5%90%8d%e7%a8%b1%e5%8d%80%e5%88%86%e5%a4%a7%e5%b0%8f%e5%af%ab%e7%9a%84%e8%a8%ad%e5%ae%9a","status":"publish","type":"post","link":"https:\/\/gwokae.mewggle.com\/wordpress\/2009\/11\/mysql-%e8%b3%87%e6%96%99%e8%a1%a8%e3%80%81%e8%b3%87%e6%96%99%e5%ba%ab%e5%90%8d%e7%a8%b1%e5%8d%80%e5%88%86%e5%a4%a7%e5%b0%8f%e5%af%ab%e7%9a%84%e8%a8%ad%e5%ae%9a\/","title":{"rendered":"MySql \u8cc7\u6599\u8868\u3001\u8cc7\u6599\u5eab\u540d\u7a31\u5340\u5206\u5927\u5c0f\u5beb\u7684\u8a2d\u5b9a"},"content":{"rendered":"<p>MySql \u8cc7\u6599\u8868(table)\u3001\u8cc7\u6599\u5eab\u540d\u7a31(database names)\u5340\u5206\u5927\u5c0f\u5beb(Case Sensitive)<\/p>\n<p><span class=\"note\">\u53c3\u8003\u6587\u4ef6\uff1a <a href=\"http:\/\/dev.mysql.com\/doc\/refman\/5.0\/en\/identifier-case-sensitivity.html\">http:\/\/dev.mysql.com\/doc\/refman\/5.0\/en\/identifier-case-sensitivity.html<\/a><\/span><\/p>\n<p>\u5e6b\u5ba2\u6236\u8f49\u79fb\u7cfb\u7d71\u5230Linux\u537b\u767c\u73feLinux\u4e0a\u7684Mysql\u6709\u5340\u5206table\u53caDB name\u7684\u5927\u5c0f\u5beb\u7684\u554f\u984c\uff0c\u5c0e\u81f4\u539f\u672c\u5beb\u7684query\u4e0d\u76f8\u5bb9\u3002google\u5f8c\u767c\u73fe\u9019\u548cmysql\u7684\u8a2d\u5b9a\u6709\u95dc\u4fc2\uff0c\u5c0e\u81f4mysql\u662f\u5340\u5206\u5927\u5c0f\u5beb\u7684\u3002<\/p>\n<p>\u9700\u8981\u914d\u5408 lower_case_table_names \u9019\u500b\u53c3\u6578\u4f86\u8abf\u6574\uff0c\u9019\u500b\u662fmysqld\u7684\u555f\u52d5\u53c3\u6578\uff0c\u6240\u4ee5\u53ef\u4ee5\u5beb\u5728 my.ini \u6216 my.cnf \u4e2d\u3002<br \/>\n\u53c3\u6578\u7c21\u7565\u8aaa\u660e<\/p>\n<p>\u4ee5\u4e0b\u662f\u91dd\u5c0d\u9019\u500b\u53c3\u6578\u7684\u5c0f\u7ffb\u8b6f(\u8a73\u60c5\u8acb\u770b\u5b98\u65b9\u6587\u4ef6)<br \/>\n<strong>lower_case_table_names = 0<\/strong> (Windows\u9810\u8a2d)<br \/>\n\u8cc7\u6599\u8868(table)\u53ca\u8cc7\u6599\u5eab\u540d\u7a31(database names)\u4e00\u5f8b\u7528\u5c0f\u5beb\u5b58\u5728\u78c1\u789f\u4e2d\u3002\u6bd4\u8f03(\u67e5\u8a62)\u6642\u662f\u5340\u5206\u5927\u5c0f\u5beb(case sensitive)\u3002<\/p>\n<p><strong>lower_case_table_names = 1<\/strong><br \/>\n\u8cc7\u6599\u8868(table)\u53ca\u8cc7\u6599\u5eab\u540d\u7a31(database names)\u4e00\u5f8b\u7528\u5c0f\u5beb\u5b58\u5728\u78c1\u789f\u4e2d\u3002\u6bd4\u8f03\u6642\u662f\u4e0d\u5340\u5206\u5927\u5c0f\u5beb(case insensitive)\u3002MySql\u8f49\u63db\u6240\u6709\u7684\u8cc7\u6599\u8868(table)\u3001\u8cc7\u6599\u5eab\u540d\u7a31(database names)\u3001table aliases(\u9019\u500b\u6211\u4e0d\u77e5\u9053\u600e\u9ebc\u7ffb\u8b6f\u6bd4\u8f03\u597d)\u540d\u7a31\u70ba\u5c0f\u5beb\u4f86\u5b58\u53d6\u3002<br \/>\n<span class=\"important\">\u8a3b\uff1a\u6240\u4ee5\u5be6\u9ad4\u6a94\u6848\u7684\u540d\u7a31\u5fc5\u9808\u5168\u70ba\u5c0f\u5beb\uff0c\u5426\u5247\u6703\u5b58\u53d6\u4e0d\u5230\u3002<\/span><\/p>\n<p><strong>lower_case_table_names = 2 <\/strong>(Mac OS X\u9810\u8a2d)<br \/>\n\u8cc7\u6599\u8868(table)\u3001\u8cc7\u6599\u5eab\u540d\u7a31(database names)\u5132\u5b58\u6642\u78c1\u789f\u7684\u6a94\u6848\u5340\u5206\u5927\u5c0f\u5beb\u3002\u4f46\u67e5\u8a62\u6bd4\u8f03\u6642MySQL\u5c07\u67e5\u8a62\u8f49\u63db\u6210\u5c0f\u5beb\uff0c\u4e0d\u662f\u5340\u5206\u5927\u5c0f\u5beb\u3002\u4f46\u9019\u500b\u8a2d\u5b9a\u50c5\u9069\u7528\u65bc\u4e0d\u5340\u5206\u5927\u5c0f\u5beb\u7684\u6a94\u6848\u7cfb\u7d71\u3002<\/p>\n<p>\u6240\u4ee5\u5982\u679c\u8981\u5c07Case sensitive\u7684\u8cc7\u6599\u5eab\u6539\u6210case insenstive\uff0c\u5fc5\u9808\u628alower_case_table_names = 1 \u6216 2 \u3002\u4f462\u53ea\u4f7f\u7528\u65bcMac OS X\u3001Windows\u4e4b\u985e\u4e0d\u5340\u5206\u5927\u5c0f\u5beb\u7684\u7cfb\u7d71\uff0c\u6240\u4ee5\u5fc5\u9808\u8a2d\u5b9a\u70ba1\uff0c\u4f46\u8a2d\u5b9a\u70ba1\u6642\uff0c\u5be6\u9ad4\u5132\u5b58\u8cc7\u6599\u7684\u6a94\u540d\u5c31\u5fc5\u9808\u5168\u662f\u5c0f\u5beb\uff0c\u5426\u5247\u6703\u5b58\u53d6\u4e0d\u5230\uff0c\u4f46\u9019\u500b\u7cfb\u7d71\u5728production\u4e2d\uff0c\u6240\u4ee5\u6211\u4e0d\u6562\u8cbf\u7136\u53bb\u6539data\u4e2d\u7684\u6a94\u6848(\u842c\u4e00\u6539\u58de\u4e86\uff0c\u6211\u4e5f\u6b7b\u5b9a\u4e86)\uff0c\u6240\u4ee5\u9019\u500b\u65b9\u6848\u662f\u4e0d\u662f\u53ef\u884c\u53ef\u80fd\u9084\u8981\u5be6\u9a57\u4e00\u4e0b\u3002<\/p>\n<p>\u8b1d\u8b1d\u89c0\u8cde<\/p>\n<p>Ps. \u56e0\u70ba\u9084\u6c92\u6709\u7814\u7a76\u5f97\u5f88\u6df1\uff0c\u6240\u4ee5\u672c\u6587\u4e2d\u61c9\u8a72\u6709\u4e9b\u8b2c\u8aa4\uff0c\u6240\u4ee5\u5982\u679c\u6709\u932f\u9ebb\u7169\u9084\u8acb\u6307\u6b63\u5695\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>MySql \u8cc7\u6599\u8868(table)\u3001\u8cc7\u6599\u5eab\u540d\u7a31(database names)\u5340\u5206\u5927\u5c0f\u5beb(Case Sensitive) \u53c3\u8003\u6587\u4ef6\uff1a http:\/\/dev.mysql.com\/doc\/refman\/5.0\/en\/identifier-case-sensitivity.html \u5e6b\u5ba2\u6236\u8f49\u79fb\u7cfb\u7d71\u5230Linux\u537b\u767c\u73feLinux\u4e0a\u7684Mysql\u6709\u5340\u5206table\u53caDB name\u7684\u5927\u5c0f\u5beb\u7684\u554f\u984c\uff0c\u5c0e\u81f4\u539f\u672c\u5beb\u7684query\u4e0d\u76f8\u5bb9\u3002google\u5f8c\u767c\u73fe\u9019\u548cmysql\u7684\u8a2d\u5b9a\u6709\u95dc\u4fc2\uff0c\u5c0e\u81f4mysql\u662f\u5340\u5206\u5927\u5c0f\u5beb\u7684\u3002 \u9700\u8981\u914d\u5408 lower_case_table_names \u9019\u500b\u53c3\u6578\u4f86\u8abf\u6574\uff0c\u9019\u500b\u662fmysqld\u7684\u555f\u52d5\u53c3\u6578\uff0c\u6240\u4ee5\u53ef\u4ee5\u5beb\u5728 my.ini \u6216 my.cnf \u4e2d\u3002 \u53c3\u6578\u7c21\u7565\u8aaa\u660e \u4ee5\u4e0b\u662f\u91dd\u5c0d\u9019\u500b\u53c3\u6578\u7684\u5c0f\u7ffb\u8b6f(\u8a73\u60c5\u8acb\u770b\u5b98\u65b9\u6587\u4ef6) lower_case_table_names = 0 (Windows\u9810\u8a2d) \u8cc7\u6599\u8868(table)\u53ca\u8cc7\u6599\u5eab\u540d\u7a31(database names)\u4e00\u5f8b\u7528\u5c0f\u5beb\u5b58\u5728\u78c1\u789f\u4e2d\u3002\u6bd4\u8f03(\u67e5\u8a62)\u6642\u662f\u5340\u5206\u5927\u5c0f\u5beb(case sensitive)\u3002 lower_case_table_names = 1 \u8cc7\u6599\u8868(table)\u53ca\u8cc7\u6599\u5eab\u540d\u7a31(database names)\u4e00\u5f8b\u7528\u5c0f\u5beb\u5b58\u5728\u78c1\u789f\u4e2d\u3002\u6bd4\u8f03\u6642\u662f\u4e0d\u5340\u5206\u5927\u5c0f\u5beb(case insensitive)\u3002MySql\u8f49\u63db\u6240\u6709\u7684\u8cc7\u6599\u8868(table)\u3001\u8cc7\u6599\u5eab\u540d\u7a31(database names)\u3001table aliases(\u9019\u500b\u6211\u4e0d\u77e5\u9053\u600e\u9ebc\u7ffb\u8b6f\u6bd4\u8f03\u597d)\u540d\u7a31\u70ba\u5c0f\u5beb\u4f86\u5b58\u53d6\u3002 \u8a3b\uff1a\u6240\u4ee5\u5be6\u9ad4\u6a94\u6848\u7684\u540d\u7a31\u5fc5\u9808\u5168\u70ba\u5c0f\u5beb\uff0c\u5426\u5247\u6703\u5b58\u53d6\u4e0d\u5230\u3002 lower_case_table_names = 2 (Mac OS X\u9810\u8a2d) \u8cc7\u6599\u8868(table)\u3001\u8cc7\u6599\u5eab\u540d\u7a31(database names)\u5132\u5b58\u6642\u78c1\u789f\u7684\u6a94\u6848\u5340\u5206\u5927\u5c0f\u5beb\u3002\u4f46\u67e5\u8a62\u6bd4\u8f03\u6642MySQL\u5c07\u67e5\u8a62\u8f49\u63db\u6210\u5c0f\u5beb\uff0c\u4e0d\u662f\u5340\u5206\u5927\u5c0f\u5beb\u3002\u4f46\u9019\u500b\u8a2d\u5b9a\u50c5\u9069\u7528\u65bc\u4e0d\u5340\u5206\u5927\u5c0f\u5beb\u7684\u6a94\u6848\u7cfb\u7d71\u3002 \u6240\u4ee5\u5982\u679c\u8981\u5c07Case sensitive\u7684\u8cc7\u6599\u5eab\u6539\u6210case insenstive\uff0c\u5fc5\u9808\u628alower_case_table_names = 1 \u6216 2 \u3002\u4f462\u53ea\u4f7f\u7528\u65bcMac OS X\u3001Windows\u4e4b\u985e\u4e0d\u5340\u5206\u5927\u5c0f\u5beb\u7684\u7cfb\u7d71\uff0c\u6240\u4ee5\u5fc5\u9808\u8a2d\u5b9a\u70ba1\uff0c\u4f46\u8a2d\u5b9a\u70ba1\u6642\uff0c\u5be6\u9ad4\u5132\u5b58\u8cc7\u6599\u7684\u6a94\u540d\u5c31\u5fc5\u9808\u5168\u662f\u5c0f\u5beb\uff0c\u5426\u5247\u6703\u5b58\u53d6\u4e0d\u5230\uff0c\u4f46\u9019\u500b\u7cfb\u7d71\u5728production\u4e2d\uff0c\u6240\u4ee5\u6211\u4e0d\u6562\u8cbf\u7136\u53bb\u6539data\u4e2d\u7684\u6a94\u6848(\u842c\u4e00\u6539\u58de\u4e86\uff0c\u6211\u4e5f\u6b7b\u5b9a\u4e86)\uff0c\u6240\u4ee5\u9019\u500b\u65b9\u6848\u662f\u4e0d\u662f\u53ef\u884c\u53ef\u80fd\u9084\u8981\u5be6\u9a57\u4e00\u4e0b\u3002 \u8b1d\u8b1d\u89c0\u8cde Ps. \u56e0\u70ba\u9084\u6c92\u6709\u7814\u7a76\u5f97\u5f88\u6df1\uff0c\u6240\u4ee5\u672c\u6587\u4e2d\u61c9\u8a72\u6709\u4e9b\u8b2c\u8aa4\uff0c\u6240\u4ee5\u5982\u679c\u6709\u932f\u9ebb\u7169\u9084\u8acb\u6307\u6b63\u5695\u3002<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[15],"tags":[],"_links":{"self":[{"href":"https:\/\/gwokae.mewggle.com\/wordpress\/wp-json\/wp\/v2\/posts\/286"}],"collection":[{"href":"https:\/\/gwokae.mewggle.com\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/gwokae.mewggle.com\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/gwokae.mewggle.com\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/gwokae.mewggle.com\/wordpress\/wp-json\/wp\/v2\/comments?post=286"}],"version-history":[{"count":0,"href":"https:\/\/gwokae.mewggle.com\/wordpress\/wp-json\/wp\/v2\/posts\/286\/revisions"}],"wp:attachment":[{"href":"https:\/\/gwokae.mewggle.com\/wordpress\/wp-json\/wp\/v2\/media?parent=286"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/gwokae.mewggle.com\/wordpress\/wp-json\/wp\/v2\/categories?post=286"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/gwokae.mewggle.com\/wordpress\/wp-json\/wp\/v2\/tags?post=286"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}