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 SENSITIVE.
When I backup my database, all table names are forced lowercase so when I restore it in Linux it complains because you can't make duplicate tables and stored procedures.
I don't have access to the MySQL configuration in the linux environment so I cant change MySQL settings to case insensitive mode.
Is there any way to force MySQL (v5.x) to use case sensitive table names in windows?
Stop the server, set lower_case_table_names , and restart the server. Reload the dump file for each database. Because lower_case_table_names is set, each database and table name is converted to lowercase as it is recreated: mysql < db1.
SQL Server is a case-sensitive back-end application. This means that a table named "addr" is distinguished from a table named "ADDR." However, because Microsoft Query is an MS-DOS-based application, it is unable to distinguish cases; therefore, Microsoft Query views "addr" and "ADDR" as the same file.
For windows, it's available in the C:\ProgramData\MySQL\MySQL Server X.X directory. Open this file in administrator mode and set the lower_case_table_names variable value to 2. These changes will not take effect until you restart the MySQL server before restarting the MySQL Server by following steps.
Field (column) names are case-insensitive regardless. EDIT: we're talking about the operating system on the MySQL server machine, not client.
Read the following chapter in the official MySQL documentation: Identifier Case Sensitivity.
Then add the following system variable to the server section, [mysqld]
, inside the my.ini
configuration file and restart the MySQL service:
lower_case_table_names=2
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With