How to check case sensitivity in sleep mode

0 vote down star

I used hibernate to get login information from mysql database. But the problem is that, for example, the username "dhiraj" in the database, now the login is completed successfully by entering the username, but it also allows you to enter by entering the user name in uppercase, for example, "DHIRAJ". I want to restrict it like this in the database. Can you tell me how to achieve this in sleep mode?

+3
source share
1 answer

I don't think sleep mode is here.

? ( , , , db, ).

, mysql . :. http://mysqldatabaseadministration.blogspot.com/2006/09/case-sensitive-mysql.html , MySQL

EDIT: , , , , :

###########
# Start case sensitive collation example
###########

mysql> create table case_cs_test (word VARCHAR(10)) CHARACTER SET latin1 COLLATE latin1_general_cs;
Query OK, 0 rows affected (0.08 sec)

mysql> INSERT INTO case_cs_test VALUES ('Frank'),('Google'),('froogle'),('flickr'),('FlicKr');
Query OK, 5 rows affected (0.00 sec)
Records: 5  Duplicates: 0  Warnings: 0

mysql> SELECT * FROM case_cs_test WHERE word  LIKE 'F%';
+---------+
| word    |
+---------+
| Frank   |
| FlicKr  |
+---------+
4 rows in set (0.00 sec)

mysql> SELECT * FROM case_cs_test WHERE word  LIKE 'f%';
+---------+
| word    |
+---------+
| froogle |
| flickr  |
+---------+
2 rows in set (0.00 sec)

###########
# end
###########
+1

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


All Articles