Search code examples
mysqlmysql-error-1267

mysql Illegal mix of collations (latin1_swedish_ci,IMPLICIT)


When I execute this query

SELECT * FROM login_table
WHERE username = 'sam'
  AND pass = AES_ENCRYPT('passabc', 'mystring') 

I keep on getting this error.

#1267 - Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (utf8_general_ci,COERCIBLE) for operation '='

Thanks in advance for any help


Solution

  • expicetly cast to the correct collation. google your error - there are too many descriptions out there what to do!

    or change your password-field from the table to the same collation as the result from AES_ENCRYPT returns (phpMyAdmin might be useful)