Setting MySQL in Linux does not differentiate table name capitalization

Source: Internet
Author: User

1.

The table name of the MySQL database is strictly case-sensitive under the Linux system, and the program developed under the Windows system is ported to the Linux system, and if the SQL statement in the program does not access the database table strictly by case, there may be an error that the table could not be found.

2.

The workaround is to modify the MySQL configuration file my.cnf, add the following configuration options in the [mysqld] section lower_case_table_names = 1, restart the MySQL service.

3.

But this approach is not a cure, the fundamental solution is to follow the good practice of cross-platform development, such as the library name, table name, field name, etc. in the SQL statement to be strictly case-sensitive, with the database name, table name, field name of the case exactly match, this will enhance the portability of the program. Avoid modifying the configuration of the deployment target environment, which may cause other apps to have no effect if the target environment deploys other applications.

Original link: http://reiz6153.blog.163.com/blog/static/40108915201110923246233/

Setting MySQL in Linux does not differentiate table name capitalization

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.