Search code examples
mysqlluamariadb

Illegal mix of collations - MariaDB 10.4 - LUA


My lua codes for mysql

Getting these error


Solution

  • as the error message says, yellowpages_posts.realUser uses collation utf8mb4_unicode_ci and users.identifier uses utf8mb_general_ci.

    you have to explicitly set the collation of one to the other, e.g.

    yellowpages_posts.realUser = users.identifier COLLATE utf8mb4_unicode_ci 
    

    also checkout https://dev.mysql.com/doc/refman/8.0/en/cast-functions.html