Entity framework creates the following request:
Select * FROM mydatabase.Industry; Pay attention to the capital letter. This works fine on mysql on Windows, but on Linux I get this error:
Table 'mydatabase.Industry' does not exist Any ideas?
This has nothing to do with the structure of the entity itself.
This is a variation of the classic default configuration in two different OS issues.
You may not need a solution, but here is the cause of your problem:
MySQL stores tables as files.
And MySQL was originally developed on Linux, where file names and therefore table names were case-sensitive (since most Linux file systems are case-sensitive).
MySQL was then ported to Windows, where the file system is not case sensitive.
In windows, the file system is not case sensitive and therefore cannot distinguish between lower and upper case files.
To fix the problems, you must add an option to ignore the case of table names.
Thus, the case-senstivity identifier configuration variable "lower_case_table_names" was created, with which you can switch these parameters.
Further information on the possible values โโof [0, 1, 2] is here: http://dev.mysql.com/doc/refman/5.0/en/identifier-case-sensitivity.html
On Windows, you can configure it in the my.ini file found in or around:
C:\Program Files\MySQL\MySQL Server XY
depending on the version used. If you do not find this option, you can simply add it to the end of the my.ini file.
On Linux, this configuration file is usually located in /etc/my.cnf or /etc/mysql/my.cnf but this may vary between Linux versions and distributions.
The default value for this value is
on Linux: Case-Senstivie on Windows: Case-Insensitive
Thus, the framework entity generated SQL, which was generated from the model with the wrong shell, works on Windows, but not on Linux.
All you have to do is change the value of lower_case_table_names on Linux to 1 in the my.cnf file so that it is not case sensitive.
Please note that although you can also make MySQL on Windows case-sensitive, this is not a good idea.
Then, remember to restart the MySQL / mysqld service before checking to see if it works.
In all cases, always remember whether it works on Linux, since the behavior of MySQL is not always the same on these two systems.
The reason for the different defaults is that on Linux you have better performance when you are in case sensitive mode, because then you do not always have lowercase names. On Windows, on the other hand, it is better to have a case insensitive configuration, because you cannot have two files with the same name that differ only in the case in the same folder. This will cause a malfunction. Thus, the default value is not case sensitive in Windows.
By the way, this is why the performance of MySQL on Linux is better than the performance on Windows (among other things, for example, better planning and a faster IO / file system on Linux)
Please note that you can also change the case sensitivity of queries (string comparison) by doing
CREATE DATABASE test_database CHARACTER SET utf8 COLLATE utf8_general_cs;
or
CREATE DATABASE test_database CHARACTER SET utf8 COLLATE utf8_general_ci;
respectively
And you can also set case sensitivity on one table, for example
DROP TABLE IF EXISTS single_test_table; CREATE TABLE single_test_table( single_test_id int unsigned NOT NULL auto_increment, ... PRIMARY KEY PK_single_test_id (single_test_id ), ... ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE utf8_general_cs;