默認情況下,mysql在創建數據庫對象時,是區分大小寫的。故與microsoft之間進行移植時,要特別注意是否存在問題。在mysql中大小寫與參數lower_case_table_names有很大關系。
以下為官方解釋:
If set to 0, table names are stored as specified and comparisons are case sensitive. If set to 1, table names are stored in lowercase on disk and comparisons are not case sensitive. If set to 2, table names are stored as given but compared in lowercase. This option also applies to database names and table aliases.
當設置為0時,存儲和比較都是大小寫敏感的;當設置為1是存儲時會轉換為小寫,比較時不區分大小寫;當設置為2時候,存儲時區分大小寫,比較的時與轉換為小寫。此選項對數據庫名和數據表名起作用。
lower_case_table_names是個只讀變量,不能直接設置生效,必須在配置文件中設置並重啟mysqld服務。
mysql> set lower_case_table_names=1;
ERROR 1238 (HY000): Variable ‘lower_case_table_names’ is a read only variable