Let MySQL in Linux the table name is not case-sensitive (real table name is all lowercase)

Source: Internet
Author: User
Tags mysql client

The application of Windows under the deployment of Linux, using the features of the Quartz cluster, so built the MYSQL intermediate table, a start to see the error:

invocation of Init method failed; nested Exception is Org.quartz.JobPersistenceException:Couldn ' t retrieve trigger:table ' unmijob. Qrtz_triggers ' doesn ' t exist [see nested Exception:com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException:Table ' Unmijob. Qrtz_triggers ' doesn ' t exist]

Connect to that database with the MySQL client and see Qrtz_triggers The table does exist, and MySQL is installed under Linux. In a case-sensitive operating system, will reckoned be a factor in the size of the table name? So the qrtz_triggers changed to uppercase Qrtz_triggers, start the application server again, this time appears:

invocation of Init method failed; nested Exception is Org.quartz.JobPersistenceException:Couldn ' t retrieve trigger:table ' unmijob. Qrtz_cron_triggers ' doesn ' t exist [see Nested exception:com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table ' Unmijob. Qrtz_cron_triggers ' doesn ' t exist]

Description Table Qrtz_triggers table was found and could not find the following qrtz_cron_triggers table. Such an image before the show in Linux MySQL indicates that is case-sensitive is exposed, it was mostly under Windows write programs, and the code in the SQL statement is also used in lowercase, so did not touch. Now Quartz prefer to capitalize, so the problem is.

Know the reason, find a solution can be targeted, Google MySQL Linux table name is not case-sensitive, the answer is immediately found:

Need to change the MySQL configuration file, Linux under the MySQL configuration file may be/etc/my.cnf, or/etc/mysql/my.cnf, which depends on how you install. If it is/etc/my.cnf, then execute

sudo vi/etc/my.cnf

In the [Mysqld] section, add:

This article original link http://unmi.cc/linux-mysql-lower-case-table-names/, from Yehuang Unmi Blog

Lower_case_table_names=1

Then save and restart the MySQL service with Sudo/etc/init.d/mysql Restart to make the Linux system insensitive to table name capitalization.

In fact, not to say that Linux for MySQL table name ignoring case, but after applying the above configuration, the MySQL service program will come from the application of the request table name converted to lowercase, as you query select* Unmi_table,mysql will be considered a query of select * FROM Unmi_table, so join in

Lower_case_table_names=1

/p>

invocation of Init method failed; nested Exception is Org.quartz.JobPersistenceException:Couldn ' t retrieve trigger:table ' unmijob.qrtz_triggers ' doesn ' t exist [See nested exception:com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException:Table ' unmijob.qrtz_triggers ' Doesn ' t exist]

Because the MySQL service program considers the table name to be lowercase unmi_table, the table name in the database is not.

And at this time in the MySQL client can not change qrtz_triggers to Qrtz_triggers. Because the case of the table name corresponds to the frm file under the data directory in the file system.


Let MySQL in Linux the table name is not case-sensitive (real table name is all lowercase)

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.