Mysql database case sensitivity

Source: Internet
Author: User
Tags sql error


To solve the case sensitivity problem of mysql databases, a small problem occurred when deploying a java project to a linux server today. The database is mysql and the project is on my local computer (in windows) no problem.
Error message: 00:01:29, 314 INFO [org. springframework. jdbc. datasource. jdbcTransactionObjectSupport]-<JDBC 3.0 Savepoint class is available> 00:01:29, 903 WARN [org. hibernate. util. JDBCExceptionReporter]-<SQL Error: 1146, SQLState: 42S02> www.2cto.com 00:01:29, 903 ERROR [org. hibernate. util. JDBCExceptionReporter]-<Table 'lelesys. t_UUU 'doesn' t exist> thought it was a configuration file with an error. It was changed several times. As a result, I found the cause of the problem was a database configuration problem.
The main reason is: "in MySQL, databases and tables are actually directories and files under the Data Directory. Therefore, the sensitivity of the operating system determines the case sensitivity of the database and table names. This means that the database and table names are case-insensitive in Windows and are case-sensitive in most types of Unix/Linux systems. MySQL is case sensitive and can be controlled by the lower_case_table_names parameter in the configuration file.
WINDOWS: edit my. ini file, add lower_case_table_names = 0 under [mysqld] (Note: when it is 0, it is lowercase sensitive; when it is 1, it is lowercase insensitive; The default value is 1 ), mySql can define the table name according to the case-insensitive State of the SQL statement for table creation. Www.2cto.com LINUX: edit/etc/my. in the cnf file, add the lower_case_table_names = 1 parameter in the [mysqld] section and set the corresponding value (Note: when it is 0, it is lowercase sensitive, and when it is 1, it is lowercase insensitive, the default value is 0 )." (Reference sentences in online articles ). Of course, this solves the problem, but removing the case sensitivity is not a good thing, and there will certainly be many hidden dangers .... it is best to modify the value corresponding to the table attribute in the ing file, and change the table name in the ing file to the same case as the table name in the database. It makes sense to do this...

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.