Retrieving data with MYSQL for Linux

I recently started using Linux (Ubuntu 9.10) instead of windows. I am working on a Java application with Spring, MYSQL with jpa. However, before installing linux, I made a backup file from the database, then installed linux, installed MYSQL Query Browser and admin tools, and using the Admin tool I restored the backup file, then I got all the tables and made a simple select statement from one of the tables and got the result ok and everything seems to be working fine.

There is a USER table, and there namedQuery defined for the user to get Name, the problem is that when I pass the correct username, I still get nothing!

I really don't know what the problem is! The application worked perfectly under the windows!

Please help me solve this problem?

Thanks in advance.

+3
source share
3 answers

The first thing that comes to mind is that MySQL table names are case sensitive in Linux, but not in Windows. that is, this could work on Windows:

SELECT ... FROM User ...

but on Linux you need to use the correct case for the table name:

SELECT ... FROM User ...

but without additional information it’s really hard to say.

+2
source

There are some settings that have different default values ​​under Windows and Linux, case sensitivity for table names, etc. are one of them. It may be that there is no default setting for one value for Windows, and another for Linux.

+1
source

, , , ! , , , , USER , .. tomcat, JPA @Entity, @Entity, USER, , , table, , ! - , .

Workaround to solve this problem. I modified the backup file by renaming all the tables as expected by JPA to avoid creating them again when the application loads.

I really don't know if there is a better solution, but it worked for me.

Finally, thank you very much for your help.

0
source

Source: https://habr.com/ru/post/1737907/


All Articles