您好,登錄后才能下訂單哦!
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. |
默認(rèn)為0,大小寫敏感。
設(shè)置1,大小寫不敏感。創(chuàng)建的表,數(shù)據(jù)庫都是以小寫形式存放在磁盤上,對于sql語句都是轉(zhuǎn)換為小寫對表和DB進(jìn)行查找。
設(shè)置2,創(chuàng)建的表和DB依據(jù)語句上格式存放,凡是查找都是轉(zhuǎn)換為小寫進(jìn)行。
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:
當(dāng)想設(shè)置lower_case_table_names = 1時,在重啟數(shù)據(jù)庫實(shí)例之前就需要將原來的數(shù)據(jù)庫和表轉(zhuǎn)換為小寫。
官方文檔的解釋。要開啟lower_case_table_names = 1 。先要將大寫字母數(shù)據(jù)庫更改為小寫。否則將找不到數(shù)據(jù)庫名。
所以要想忽略大小寫,還需要提前將大寫數(shù)據(jù)庫名更改小寫,否則報錯。數(shù)據(jù)庫名無法rename.可以新建一個小寫的數(shù)據(jù)庫名。
然后rename table 到新的數(shù)據(jù)庫,完成表的遷移。
在進(jìn)行數(shù)據(jù)庫參數(shù)設(shè)置之前,需要掌握這個參數(shù)帶來的影響,切不可盲目設(shè)置。
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進(jìn)行舉報,并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。