I have a java program that I made that will create a 5 digit string and add it to a mysql database. The strings that are generated will be every combination of the numbers 1-9 the letters a-z and A-Z like
00000
…
00009
0000a
…
0000z
0000A
…
0000Z
00010
…
00019
and so on
My problem is when adding these values to the database it will not add 0000A because 0000a is already in there
for example if I
INSERT INTO `mytable`(`mycolumn`) VALUES ("00000");
INSERT INTO `mytable`(`mycolumn`) VALUES ("0000a");
INSERT INTO `mytable`(`mycolumn`) VALUES ("0000A");
the only values that appear in my database are 00000 and 0000a
Is there anyway to have mysql make this distinction between the two so I can have strings that appear unique
MySql strings are case sensitive by default.
You could use a case sensitive collation like
utf8_binin theMYCOLUMNfield: