Mysql multi-table query 1267 error report

const books = await mysql("books")
                  .select("books.*","csessioninfo.user_info")
                  .join("csessioninfo","books.openid","csessioninfo.open_id")
                  // .orderBy("id","desc")
 code: "ER_CANT_AGGREGATE_2COLLATIONS", errno: 1267, sqlMessage: "Illegal mix of collations (utf8mb4_0900_ai_ci,IMPLICIT) and (utf8mb4_unicode_ci,IMPLICIT) for operation \"=\"", sqlState: "HY000", index: 0, sql: "select `books`.*, `csessioninfo`.`user_info` from `books` inner join `csessioninfo` on `books`.`openid` = `csessioninfo`.`open_id`" } +1ms

execute the above code with an error of 1267. I don"t know what caused it.


mysql> select `books`.*, `csessioninfo`.`user_info` from `books` inner join `csessioninfo` on `books`.`openid` = `csessioninfo`.`open_id`
    -> ;
ERROR 1267 (HY000): Illegal mix of collations (utf8mb4_0900_ai_ci,IMPLICIT) and (utf8mb4_unicode_ci,IMPLICIT) for operation "="
Mar.19,2021

you can see from the error message that the sorting rules of the books table and csessioninfo are inconsistent. You can modify the books table to change the collation to utf8mb4_unicode_ci .

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3b72b-4eefb.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3b72b-4eefb.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?