开发者

xampp and mysql all columns in table are lower case in php

If I print_r($object) I get:

Array ( [id] => 1 [ime] => rwe [letnica] => 0 [mesec] => 1 [datoteka] => [disciplineid] => 2 [rangtekmovanjaid] => 3 )

My DB columns are:

- disciplineId
- rangtekmovanjaId

I set lower_case_table_names=0 in my.ini for mysql 5.0 part 开发者_开发问答of xampp but is the same. What is wrong?


To fix this on XAMPP go to your my.ini file (e.g. inside C:\xampp\mysql\bin) and find the [mysqld] area.

Add to it the following line:

lower_case_table_names=0

restart your apache & mysql

now your table names are case sensitive even on a windows system.


According to MySQL manual

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 set this variable to 0 on such a system and access MyISAM tablenames using different lettercases, index corruption may result. On Windows the default value is 1. On Mac OS X, the default value is 2.

MySQL: Identifier Case Sensitivity

In MySQL, databases correspond to directories within the data directory. Each table within a database corresponds to at least one file within the database directory (and possibly more, depending on the storage engine). Consequently, the case sensitivity of the underlying operating system plays a part in the case sensitivity of database and table names. This means database and table names are not case sensitive in Windows, and case sensitive in most varieties of Unix. One notable exception is Mac OS X, which is Unix-based but uses a default file system type (HFS+) that is not case sensitive.

more

By default, table aliases are case sensitive on Unix, but not so on Windows or Mac OS X.

That means, on Linux servers (Unix) table/column name "Test" is not equal with "test", "TEST", "tESt", etc. by default.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜