{"id":204,"date":"2007-01-31T06:56:58","date_gmt":"2007-01-31T06:56:58","guid":{"rendered":"http:\/\/www.jason695.idv.tw:81\/wordpress\/?p=204"},"modified":"2007-01-31T07:11:20","modified_gmt":"2007-01-31T07:11:20","slug":"mysql%e7%9a%84%e5%a4%a7%e5%b0%8f%e5%af%ab%e6%95%8f%e6%84%9f%e6%80%a7","status":"publish","type":"post","link":"https:\/\/jason695.why3s.tw\/wordpress\/2007\/01\/31\/mysql%e7%9a%84%e5%a4%a7%e5%b0%8f%e5%af%ab%e6%95%8f%e6%84%9f%e6%80%a7\/","title":{"rendered":"MySQL\u7684\u5927\u5c0f\u5beb\u654f\u611f\u6027"},"content":{"rendered":"<p>\u5728 MySQL \u4e2d\uff0c\u8cc7\u6599\u5eab\u548c\u8868\u5c0d\u5c31\u65bc\u90a3\u4e9b\u76ee\u9304\u4e0b\u7684\u76ee\u9304\u548c\u6587\u4ef6\u3002\u56e0\u800c\uff0c\u64cd\u4f5c\u7cfb\u7d71\u7684\u654f\u611f\u6027\u6c7a\u5b9a\u8cc7\u6599\u5eab\u548c\u8868\u547d\u540d\u7684\u5927\u5c0f\u5beb\u654f\u611f\u3002\u9019\u5c31\u610f\u5473\u8457\u8cc7\u6599\u5eab\u548c\u8868\u540d\u5728 Windows \u4e2d\u662f\u5927\u5c0f\u5beb\u4e0d\u654f\u611f\u7684\uff0c\u800c\u5728\u5927\u591a\u6578\u985e\u578b\u7684 Unix \u7cfb\u7d71\u4e2d\u662f\u5927\u5c0f\u5beb\u654f\u611f\u7684\u3002\u4e00\u500b\u7279\u4f8b\u662f Mac OS X\uff0c\u7576\u9810\u8a2d\u7684 HFS+ \u6587\u4ef6\u7cfb\u7d71\u4f7f\u7528\u6642\u3002\u7136\u800c Mac OS X \u9084\u652f\u63f4 UFS \u5377\uff0c\u90a3\u4e9b\u5728 Mac OS X \u662f\u5927\u5c0f\u5beb\u654f\u611f\u7684\u5c31\u5982\u4ed6\u5011\u5728\u4efb\u4e00 Unix \u4e0a\u4e00\u6a23\u3002\u67e5\u770b\u7ae0\u7bc0 <a href=\"http:\/\/www.php5.idv.tw\/documents\/mysql4tw\/manual1.html#Extensions_to_ANSI\">1.8.3  MySQL \u5c0d ANSI SQL92 \u7684\u64f4\u5c55<\/a>\u3002<\/p>\n<p><strong>\u6ce8\u610f\uff1a<\/strong>\u76e1\u7ba1\u5728 Windows \u4e2d\u8cc7\u6599\u5eab\u8207\u8868\u540d\u662f\u5ffd\u7565\u5927\u5c0f\u5beb\u7684\uff0c\u4f60\u4e0d\u61c9\u8a72\u5728\u540c\u4e00\u500b\u67e5\u8a62\u4e2d\u4f7f\u7528\u4e0d\u540c\u7684\u5927\u5c0f\u5beb\u4f86\u53c3\u7167\u4e00\u500b\u7d66\u5b9a\u7684\u8cc7\u6599\u5eab\u548c\u8868\u3002\u4e0b\u9762\u7684\u67e5\u8a62\u5c07\u4e0d\u80fd\u5de5\u4f5c\uff0c\u56e0\u70ba\u5b83\u4ee5 <code>my_table<\/code> \u548c <code>MY_TABLE<\/code> \u53c3\u7167\u4e00\u500b\u8868\uff1a<\/p>\n<pre>mysql> SELECT * FROM my_table WHERE MY_TABLE.col=1;<\/pre>\n<p>\u5217\u540d\u8207\u5217\u7684\u5225\u540d\u5728\u6240\u6709\u7684\u60c5\u6cc1\u4e0b\u5747\u662f\u5ffd\u7565\u5927\u5c0f\u5beb\u7684\u3002<\/p>\n<p>\u8868\u7684\u5225\u540d\u662f\u5340\u5206\u5927\u5c0f\u5beb\u7684\u3002\u4e0b\u9762\u7684\u67e5\u8a62\u5c07\u4e0d\u80fd\u5de5\u4f5c\uff0c\u56e0\u70ba\u5b83\u7528  <code>a<\/code> \u548c <code>A<\/code> \u53c3\u7167\u5225\u540d\uff1a<\/p>\n<pre>mysql> SELECT col_name FROM tbl_name AS a\r\n->                 WHERE a.col_name = 1 OR A.col_name = 2;<\/pre>\n<p>\u5982\u679c\u8a18\u61b6\u8cc7\u6599\u5eab\u548c\u8868\u540d\u7684\u5b57\u6bcd\u5927\u5c0f\u5beb\u6709\u56f0\u96e3\uff0c\u5efa\u8b70\u63a1\u7528\u4e00\u500b\u4e00\u81f4\u4e00\u7d04\u5b9a\uff0c\u4f8b\u5982\u7e3d\u662f\u4ee5\u5c0f\u5beb\u5b57\u6bcd\u5efa\u7acb\u8cc7\u6599\u5eab\u548c\u8868\u3002<\/p>\n<p>\u907f\u514d\u9019\u500b\u554f\u984c\u7684\u53e6\u4e00\u500b\u8fa6\u6cd5\u5c31\u662f\u4ee5 <code>-O lower_case_table_names=1<\/code> \u53c3\u6578\u555f\u52d5 <code>mysqld<\/code>\u3002\u9810\u8a2d\u5730\u5728 Windows \u4e2d\u9019\u500b\u9078\u9805\u70ba 1 \uff0c\u5728  Unix \u4e2d\u70ba 0\u3002<\/p>\n<p>\u5982\u679c <code>lower_case_table_names<\/code> \u70ba 1 \uff0cMySQL \u5c07\u5728\u5132\u5b58\u8207\u5c0b\u627e\u6642\u5c07\u6240\u6709\u7684\u8868\u540d\u8f49\u63db\u70ba\u5c0f\u5beb\u5b57\u7dda\u3002(\u5f9e MySQL 4.0.2 \u958b\u59cb\uff0c\u9019\u500b\u9078\u9805\u540c\u6a23\u9069\u7528\u65bc\u8cc7\u6599\u5eab\u540d\u3002) \u6ce8\u610f\uff0c\u7576\u4f60\u8b8a\u66f4\u9019\u500b\u9078\u9805\u6642\uff0c\u4f60\u5fc5\u9808\u5728\u555f\u52d5 <code>mysqld<\/code> \u524d\u9996\u5148\u5c07\u8001\u7684\u8868\u540d\u8f49\u63db\u70ba\u5c0f\u5beb\u5b57\u6bcd\u3002<\/p>\n<p><font color=\"red\">\uff08\u5982\u679c\u4f7f\u7528 &#8211;defaults-file=&#8230;\\my.cnf \u53c3\u6578\u4f86\u8b80\u53d6\u6307\u5b9a\u7684\u914d\u7f6e\u6a94\u6848\u555f\u52d5 mysqld \u7684\u8a71\uff0c\u4f60\u9700\u8981\u5728\u914d\u7f6e\u6a94\u6848\u7684 [mysqld] \u5340\u6bb5\u4e0b\u589e\u52a0\u4e00\u884c lower_case_table_names=1\uff09<\/font><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5728 MySQL \u4e2d\uff0c\u8cc7\u6599\u5eab\u548c\u8868\u5c0d\u5c31\u65bc\u90a3\u4e9b\u76ee\u9304\u4e0b\u7684\u76ee\u9304\u548c\u6587\u4ef6\u3002\u56e0\u800c\uff0c\u64cd\u4f5c\u7cfb\u7d71\u7684\u654f\u611f\u6027\u6c7a\u5b9a\u8cc7\u6599\u5eab\u548c\u8868\u547d\u540d\u7684\u5927\u5c0f\u5beb\u654f &hellip; <a href=\"https:\/\/jason695.why3s.tw\/wordpress\/2007\/01\/31\/mysql%e7%9a%84%e5%a4%a7%e5%b0%8f%e5%af%ab%e6%95%8f%e6%84%9f%e6%80%a7\/\" class=\"more-link\">\u95b1\u8b80\u5168\u6587 <span class=\"screen-reader-text\">MySQL\u7684\u5927\u5c0f\u5beb\u654f\u611f\u6027<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[5],"tags":[],"class_list":["post-204","post","type-post","status-publish","format-standard","hentry","category-5","no-featured-image"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/jason695.why3s.tw\/wordpress\/wp-json\/wp\/v2\/posts\/204","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jason695.why3s.tw\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jason695.why3s.tw\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jason695.why3s.tw\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/jason695.why3s.tw\/wordpress\/wp-json\/wp\/v2\/comments?post=204"}],"version-history":[{"count":0,"href":"https:\/\/jason695.why3s.tw\/wordpress\/wp-json\/wp\/v2\/posts\/204\/revisions"}],"wp:attachment":[{"href":"https:\/\/jason695.why3s.tw\/wordpress\/wp-json\/wp\/v2\/media?parent=204"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jason695.why3s.tw\/wordpress\/wp-json\/wp\/v2\/categories?post=204"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jason695.why3s.tw\/wordpress\/wp-json\/wp\/v2\/tags?post=204"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}