MySQL Set table name is not case-sensitive in Ubuntu

Source: Internet
Author: User
Tags lowercase

1. Preface

Recently in the company to optimize an Android project, the server has been deployed to a formal environment, not directly in the formal environment testing, need to deploy a set of test environment, the background is busy, so I came, installed on Ubuntu Jdk,tomcat and MySQL, ready to start deployment. Found a problem, the name of some of the tables automatically generated by Hibernate has all become uppercase, and under Windows is all lowercase, through the online search data, found that MySQL under Windows is not case-sensitive , So even if hibernate is defined as an uppercase table name, when the corresponding table is generated, it is converted to lowercase, but under Linux systems, MySQL is case-sensitive , resulting in uppercase tables. To be consistent with the Windows environment, it is convenient to change the default configuration of MySQL so that its table names are not case sensitive.

2. Specific steps

1. Switch to the root user and enter the/ETC/MYSQL/MYSQL.CONF.D directory

2. Open the Mysqld.cnf file and add a line under "mysqld": Lower_case_table_names=1

3. Restart MySQL, using the command:/etc/init.d/mysql restart

With the above three steps, you can set the MySQL table name in Ubuntu to be case insensitive, so that the table names generated by hibernate are lowercase.

3. Summary

The overall deployment is still relatively smooth, but this problem has trapped me for a long time, in fact, the specific operation as I said above, three steps can be achieved. But I began to go a lot of detours, once wanted to uninstall MySQL after reloading, this is the next worst. The problem is that I am not familiar with Linux and MySQL, when there is a problem, the beginning of no cool analysis and positioning problems, leading to delay a lot of time, and then calm down to think about the problem, through the online search to solve the problem. So after dealing with the problem, must be calm, important things to say three times: calm, calm, calm !!!

MySQL Set table name is not case-sensitive in Ubuntu

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.