Linux settings MySQL is case insensitive

Source: Internet
Author: User

MySQL under Linux database name, table name, column name, alias casing rules:
1, database name and table name are strictly case-sensitive
2, table aliases are strictly case-sensitive
3, column name and column alias in all cases are ignored case
4. Variable names are also strictly case-sensitive
Attention:
A, Linux under the default after MySQL installation: Differentiate the case of the table name, do not distinguish the case of the column name
B, change the case of the table name to distinguish the rules of the method: Log in with the root account, in/etc/my.cnf or/etc/mysql/my.cnf in the [mysqld] Add add Lower_case_table_names=1

Java code
  1. # The MySQL server
  2. [Mysqld]
  3. Port = 3306
  4. Socket =/var/lib/mysql/mysql.sock
  5. Skip-external-locking
  6. Key_buffer_size = 16M
  7. Max_allowed_packet = 1M
  8. Table_open_cache =
  9. Sort_buffer_size = 512K
  10. Net_buffer_length = 8K
  11. Read_buffer_size = 256K
  12. Read_rnd_buffer_size = 512K
  13. Myisam_sort_buffer_size = 8M
  14. # Add here
  15. lower_case_table_names=1


Restart the MySQL service, and if the settings are successful, the table name case is no longer distinguished.


MySQL database names, table names, column names, aliases are not case-sensitive under Windows.
If you want to distinguish the case, then the mysqld part inside the My.ini
Join Lower_case_table_names=0
Note: Even if you change this setting in Windows, it is not case-sensitive at query time. The case is only different when the export is imported.

Linux settings MySQL is case insensitive

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.