MySQL cannot find the table because it is case sensitive.

Source: Internet
Author: User

The development process has been running on the local mysql Data. After the test is completed, connect to the LINUX Server database. The result is always an error and the table cannot be found! What I wonder about is that the table is clearly created in the server database. It is okay to test the connection and execute the query using the mysql console, but the program always reports an error!

So I started to repeat the test to find the problem. At first I thought it was the cause of driver or mysql version mismatch, But I re-wrote a JDBC connection to execute the query and found that there was no problem! It indicates that the driver is correct! So I suspected the connection pool problem. So I changed the connection in the program to a newly written JDBC connection and still encountered an error! At this time, I am going crazy! So I copied the SQL statement from the project and put it in the newly written JDBC program for execution. The same error finally occurred. The problem also surfaced a little bit! Because I have always been writing SQL statements in projects, I am used to using uppercase letters, but I usually use lower-case letters for temporary writing, so I can execute the temporary writing program, however, the SQL statement in the project cannot be executed, because mysql is case sensitive at the beginning, because it is correct on your machine. Later I checked the information and found that mysql is case sensitive by default in LINUX because of the operating system. Next we will change the mysql configuration so that it is case insensitive:

The case-insensitive MYSQL method is actually very simple:

1. Log On with ROOT and modify/etc/my. cnf

2. Add a row under [mysqld]: lower_case_table_names = 1

3. Restart the database.

I spent more than three hours on this small problem! NND, depressing! The problem is summarized here. I hope you will not take so many detours in the future!

Related Article

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.