I have been using mysql version 5.5.41 and have run into an issue. I change the collation of a specific column in my table from latin1_swedish_ci to hebrew_bin, and this ch
You must change CHANGE
by MODIFY
The first step is to convert the column to a binary data type, which removes the existing character set information without performing any character conversion:
ALTER TABLE something MODIFY name BLOB;
The next step is to convert the column to a nonbinary data type with the proper character set:
ALTER TABLE something MODIFY name VARCHAR(12) CHARACTER SET hebrew COLLATE hebrew_bin;
Or Try with this:
ALTER TABLE something MODIFY name VARCHAR(12) CHARACTER SET utf8 COLLATE utf8_unicode_ci
Read more at:
http://dev.mysql.com/doc/refman/5.5/en/charset-conversion.html
http://dev.mysql.com/doc/refman/5.5/en/charset-column.html
Please note that running any MODIFY
or CHANGE
operation on a column will (in a practical sense) remove any default value or comment on the column, as per the documentation.
When you use CHANGE or MODIFY, column_definition must include the data type and all attributes that should apply to the new column, other than index attributes such as PRIMARY KEY or UNIQUE. Attributes present in the original definition but not specified for the new definition are not carried forward.
Please do SELECT HEX(col), col FROM ...
to see what is stored for "école". Latin1 would look like E9636F6C65. Hebrew, if I am not mistaken, has not include 'é'. See http://collation-charts.org/mysql60/mysql604.hebrew_general_ci.html for what is probably the complete set of characters supported.
Assuming that is correct, do no try to convert to CHARACTER SET hebrew; you will lose information, such as 'é' being turned into '?'.
If you need to store both Hebrew characters and French accented characters (etc), use utf8.