2

I have a table with the following columns:

ID
name

Both are indexed, both must be unique.

One post has name "ussé".

I try to insert a new post with the name "usse" and get the following error:

[MySQL][ODBC 5.3(w) Driver][mysqld-5.6.16-log]Duplicate entry 'usse' for key 'name'.

What the...? MySQL can't tell those two strings apart?

Is there some way to fix this?

All my text fields have "utf8 - default collation" selected. Does this make a difference? If I need to change it to something else, is there a way to do it quickly for all tex fields in all databases? There are so many that I would like to avoid going through them manually if I can.

My connection string:

DRIVER={MySQL ODBC 5.3 Unicode Driver}; SERVER=localhost;DATABASE=example; UID=example; PASSWORD=example; OPTION=3;
lurker
  • 56,987
  • 9
  • 69
  • 103
user3402011
  • 69
  • 2
  • 6
  • Is name the primary key? – BKM Mar 11 '14 at 10:55
  • http://stackoverflow.com/questions/2344118/utf-8-general-bin-unicode – DCoder Mar 11 '14 at 10:57
  • name isn't primary key, ID is primary key – user3402011 Mar 11 '14 at 12:43
  • What is the collation (not the encoding) of your database (or the columns if you changed it on column level) –  Mar 11 '14 at 13:03
  • Where can I see that? I just started using MySQL (auto-imported a bunch of tables) so I'm wet behind my ears. All I know is that my table's have "utf8 - default collation" and the fields have "Table Default" as collation. I don't know how to set the default collation for the whole database. – user3402011 Mar 11 '14 at 13:07
  • I just checked the schema that contains all the tables and it also has "utf8 - default collation" as collation. Which means it gets the value from somewhere else? I don't know how to find that setting in MySQL workbench 6.0 that I'm using. – user3402011 Mar 11 '14 at 13:09
  • hehe, somebody just removed an incorrect answer after he posted a confusing reply... dont remember the user name though – user3402011 Mar 11 '14 at 13:19
  • If ID is primary key then why got an error as "Duplicate entry 'usse' for key 'name'" i tried inserting in my local db it inserted correctly – Ragavendran Ramesh Apr 04 '14 at 05:24

1 Answers1

0

As you can see here : How to convert an entire MySQL database characterset and collation to UTF-8?

here's a list of commands :

ALTER DATABASE databasename CHARACTER SET utf8 COLLATE utf8_unicode_ci;
ALTER TABLE tablename CONVERT TO CHARACTER SET utf8 COLLATE utf8_unicode_ci;
Community
  • 1
  • 1
medCoder
  • 231
  • 1
  • 3
  • 7