COLLATION 'utf8_general_ci' is not valid for CHARACTER SET 'latin1'

前端 未结 4 1775
灰色年华
灰色年华 2020-12-06 09:25

I am trying to fix a character encoding issue - previously we had the collation set for this column utf8_general_ci which caused issues because it is accent insensitive..

4条回答
  •  时光取名叫无心
    2020-12-06 09:53

    The same error is produced in MariaDB (10.1.36-MariaDB) by using the combination of parenthesis and the COLLATE statement. My SQL was different, the error was the same, I had:

    SELECT *
    FROM table1
    WHERE (field = 'STRING') COLLATE utf8_bin;
    

    Omitting the parenthesis was solving it for me.

    SELECT *
    FROM table1
    WHERE field = 'STRING' COLLATE utf8_bin;
    

提交回复
热议问题