Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where to change the value of lower_case_table_names=2 in XAMPP on Windows?

Tags:

mysql

xampp

I am using Windows 7 and XAMPP. I am trying to export my database and while in the process the table names are converted to lower case.

I have searched a lot, I know I have to change the value of lower_case_table_names from 0 to 2, but where do I have to change this value, in which file?

like image 711
John x Avatar asked Dec 18 '11 09:12

John x


2 Answers

Do these steps:

  1. open your MySQL configuration file: [drive]\xampp\mysql\bin\my.ini
  2. look up for: # The MySQL server [mysqld]
  3. add this right below it: lower_case_table_names = 2
  4. save the file and restart MySQL service

From: http://webdev.issimplified.com/2010/03/02/mysql-on-windows-force-table-names-to-lowercase/

like image 151
Mohammad Saberi Avatar answered Sep 27 '22 22:09

Mohammad Saberi


On linux I cannot set lower_case_table_names to 2 (it reverts to 0), but I can set it to 1.

Before changing this setting, do a complete dump of all databases, and drop all databases. You won't be able to drop them after setting lower_case_table_names to 1, because any uppercase characters in database or table names will prevent them from being referenced.

Then set lower_case_table_names to 1, restart MySQL, and re-load your data, which will convert everything to lowercase, including any subsequent queries made.

like image 45
Sam Barnum Avatar answered Sep 27 '22 23:09

Sam Barnum