mysql语句表名大小写敏感_Mysql 表名大小写敏感
默認(rèn)情況下,mysql在創(chuàng)建數(shù)據(jù)庫對象時(shí),是區(qū)分大小寫的。故與microsoft之間進(jìn)行移植時(shí),要特別注意是否存在問題。在mysql中大小寫與參數(shù)lower_case_table_names有很大關(guān)系。
以下為官方解釋:
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.
當(dāng)設(shè)置為0時(shí),存儲(chǔ)和比較都是大小寫敏感的;當(dāng)設(shè)置為1是存儲(chǔ)時(shí)會(huì)轉(zhuǎn)換為小寫,比較時(shí)不區(qū)分大小寫;當(dāng)設(shè)置為2時(shí)候,存儲(chǔ)時(shí)區(qū)分大小寫,比較的時(shí)與轉(zhuǎn)換為小寫。此選項(xiàng)對數(shù)據(jù)庫名和數(shù)據(jù)表名起作用。
lower_case_table_names是個(gè)只讀變量,不能直接設(shè)置生效,必須在配置文件中設(shè)置并重啟mysqld服務(wù)。
mysql> set lower_case_table_names=1;
總結(jié)
以上是生活随笔為你收集整理的mysql语句表名大小写敏感_Mysql 表名大小写敏感的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: mysql timestamp 并发_M
- 下一篇: excel导航窗格_Excel小技巧16