3

I did this in order to be able to create tables upper cased, now when i try to change, select or do anything with the upper cased classes i have an error because it looks for a lower cased version of it

SELECT cust_id FROM Customer LIMIT 0, 1000
Error Code: 1146. Table 'toys.customer' doesn't exist

I am using schema "toys" and it has a Customer table i properly created

Community
  • 1
  • 1
user6008337
  • 221
  • 3
  • 15

1 Answers1

1

In my.cnf do lower_case_table_names=2 , to use upper cases

From Mysql manual, about lower_case_table_names values:

0 Table and database names are stored on disk using the lettercase specified in the CREATE TABLE or CREATE DATABASE statement. Name comparisons are case sensitive. You should not set this variable to 0 if you are running MySQL on a system that has case-insensitive file names (such as Windows or OS X). If you force this variable to 0 with --lower-case-table-names=0 on a case-insensitive file system and access MyISAM tablenames using different lettercases, index corruption may result.

1 Table names are stored in lowercase on disk and name comparisons are not case sensitive. MySQL converts all table names to lowercase on storage and lookup. This behavior also applies to database names and table aliases.

2 Table and database names are stored on disk using the lettercase specified in the CREATE TABLE or CREATE DATABASE statement, but MySQL converts them to lowercase on lookup. Name comparisons are not case sensitive. This works only on file systems that are not case sensitive! InnoDB table names are stored in lowercase, as for lower_case_table_names=1.

On Unix, the default value of lower_case_table_names is 0. On Windows, the default value is 1. On OS X, the default value is 2.

After editing my.cnf values don't forget to restart MySQL.

Muhammed
  • 1,592
  • 1
  • 10
  • 18
  • the "lower_case_table_names=2" is edited at the end of the file "my.ini", in this directory "C:\ProgramData\MySQL\MySQL Server 5.7", im using windows 10. I restarted MySQL from services, it didn't worked before i restarted that way, now i can create with upper case but i can't then modify them or just use them from scripts – user6008337 Mar 04 '16 at 13:43
  • sorry I missed you are using Windows. – Muhammed Mar 04 '16 at 13:45
  • can you access mysql from command line? try there query>> show variables like '%case_table_names%'; What does it show you? – Muhammed Mar 04 '16 at 13:46
  • i am learning MySql now, i can access mysql command line, then i enter "query", i have "->" arrow and then i can enter an input, how can i show '%case_table_names%' variable ? – user6008337 Mar 04 '16 at 14:50