0

My my.cnf config file is with:

lower_case_table_names = 2

so if table name is "MyUsers" it will take as it is.

but in view: i have used as a "myusers".

in windows its working.

Now when i am trying to execute it(view) in linux server then it is saying "myusers" doesnt exists.

what is the problem in linux and its corresponding solution.

Not Duplicate: As I clearly mentioned what I need and what I get. This is in view.

Joe
  • 479
  • 3
  • 8
  • 31

1 Answers1

-1

MySQL users files for tables and views. The name of the files are identical to those of the tables as created. Windows is case-insensitive as far as addressing files is concerned. Linux is not, meaning that you can have the files myfile.txt and Myfile.txt at the same folder.

There is no way out (I learned this in the past as you are learning it now). You MUST use table/views names with the same case as they are defined. Column names, on the other hand, are case insensitive.

FDavidov
  • 3,505
  • 6
  • 23
  • 59
  • There is a way out, see the duplicate topic. – Shadow Nov 09 '16 at 09:53
  • Thank you @Shadow. I wish I saw that long ago before I had to review my whole code (over 100 Stored Procedures/Functions) and correct the names of tables. In any case, I think that avoiding conversions and use a consistent naming policy is (at least my) preferred of going. Last, I humbly accept the punishment for my error (negative vote). – FDavidov Nov 09 '16 at 10:01
  • Yep, a consistent approach is a lot better. However, if you have to use both windows with Linux / unix to host MySQL servers, then you better op to have lower case table names. Actually, you may even tweak windows to use case sensitive file names (ntfs is a case sensitive file system). – Shadow Nov 09 '16 at 10:06
  • means u r saying putting lower_case_table_names = 1; will solve the issue. how? If I want table name as "MyUsers" and in view mentioning as "myuser" will work? is it? but in that case table name itself is creating in small chars. then – Joe Nov 09 '16 at 10:09