您好,登錄后才能下訂單哦!
Mysql官方文檔的介紹:
Value |
Meaning |
0 |
Table and database names are stored on disk using the lettercase specified in the CREATE TABLE orCREATE DATABASE statement. Name comparisons are case sensitive. You should not set this variable to 0 if you are running MySQL on a system that has case-insensitive file names (such as Windows or Mac OS X). If you force this variable to 0 with --lower-case-table-names=0 on a case-insensitive file system and access MyISAM tablenames using different lettercases, index corruption may result. |
1 |
Table names are stored in lowercase on disk and name comparisons are not case sensitive. MySQL converts all table names to lowercase on storage and lookup. This behavior also applies to database names and table aliases. |
2 |
Table and database names are stored on disk using the lettercase specified in the CREATE TABLE orCREATE DATABASE statement, but MySQL converts them to lowercase on lookup. Name comparisons are not case sensitive. This works only on file systems that are not case sensitive! InnoDB table names are stored in lowercase, as for lower_case_table_names=1. |
默認為0,大小寫敏感。
設置1,大小寫不敏感。創建的表,數據庫都是以小寫形式存放在磁盤上,對于sql語句都是轉換為小寫對表和DB進行查找。
設置2,創建的表和DB依據語句上格式存放,凡是查找都是轉換為小寫進行。
If you plan to set the lower_case_table_names system variable to 1 on Unix, you must first convert your old database and table names to lowercase before stopping mysqld and restarting it with the new variable setting. To do this for an individual table, use RENAME TABLE:
當想設置lower_case_table_names = 1時,在重啟數據庫實例之前就需要將原來的數據庫和表轉換為小寫。
官方文檔的解釋。要開啟lower_case_table_names = 1 。先要將大寫字母數據庫更改為小寫。否則將找不到數據庫名。
所以要想忽略大小寫,還需要提前將大寫數據庫名更改小寫,否則報錯。數據庫名無法rename.可以新建一個小寫的數據庫名。
然后rename table 到新的數據庫,完成表的遷移。
在進行數據庫參數設置之前,需要掌握這個參數帶來的影響,切不可盲目設置。
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。