How to force case sensitive table names?

前端 未结 6 1765
花落未央
花落未央 2020-11-30 03:15

I\'m working on a MySQL database in windows.

I must move it into a Linux environment. MySQL database contains a lot of tables and stored procedures which are CASE

相关标签:
6条回答
  • 2020-11-30 03:32

    Read all this: http://dev.mysql.com/doc/refman/5.0/en/identifier-case-sensitivity.html

    Then add this system variable to the server section, [mysqld], of my.ini and restart mysql:

    /my.ini: lower_case_table_names=2

    0 讨论(0)
  • 2020-11-30 03:32

    Have a look at this article - http://dev.mysql.com/doc/refman/5.1/en/identifier-case-sensitivity.html

    Mode 2 allows to store tables with specified lettercase, but anyway, name comparisons won't be case sensitive and you won't be able to store table1 and Table1 at the same time.

    0 讨论(0)
  • 2020-11-30 03:32

    Unfortunately there's no way of making MySQL on windows to behave 100% as in Linux. What you can do, is to run a minimal VM on Virtual Box or VMware player with TurnKey - MySQL Appliance.

    In my personal experience, I've found quite useful to have a VM with a configuration similar to the deployment environment to diagnose problems.

    0 讨论(0)
  • 2020-11-30 03:48

    On windows put lower_case_table_names=2 at the end of file C:\ProgramData\MySQL\MySQL Server 5.7\my.ini

    0 讨论(0)
  • 2020-11-30 03:48

    i add this line and it solve the different case problem

    lower_case_table_names=1

    in /etc/my.cnf

    you can see how to set mysql variable "lower_case_table_names" form this page : https://dev.mysql.com/doc/refman/5.0/en/server-system-variables.html#sysvar_lower_case_table_names

    0 讨论(0)
  • 2020-11-30 03:50

    Add this property to lower_case_table_names=2 to my.ini

    0 讨论(0)
提交回复
热议问题