Make mysql case sensitive?

别来无恙 提交于 2019-12-10 13:14:14

问题


I wrote

select * from mytable

In my ASP.net app on Windows it works fine. On Linux it complains I used mytable instead of MyTable. How do I set MySQL on Windows to be case sensitive or set Linux to be case insensitive when dealing with table names?


回答1:


See 8.2.2. Identifier Case Sensitivity in the mySQL manual.

Short version: Use the lower_case_table_names system variable to achieve case insensitivity on Linux/Unix.




回答2:


There is a setting for this. See this link: http://www.parkroad.co.za/blog/2007/02/07/mysql-case-sensitivity-of-table-names-between-windows-and-linux-systems

Here's the important part: ...you can look for the setting: lower_case_table_names in your my.ini file, found in or around: C:\Program Files\MySQL\MySQL Server 4.1, depending on which version you are running. If you don't find the setting, you can just add it to the end of the my.ini file, as I did, like so:

lower_case_table_names=0

Dan



来源:https://stackoverflow.com/questions/8438286/make-mysql-case-sensitive

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!