Illegal mix of collations error in MySql

后端 未结 19 2290
醉梦人生
醉梦人生 2020-11-29 01:11

Just got this answer from a previous question and it works a treat!

SELECT username, (SUM(rating)/COUNT(*)) as TheAverage, Count(*) as TheCount 
FROM ratings         


        
19条回答
  •  盖世英雄少女心
    2020-11-29 01:57

    Was getting Illegal mix of collations while creating a category in Bagisto. Running these two commands from @Quy Le 's answer solved the issue for me:

    --set utf8 for connection

    SET collation_connection = 'utf8_general_ci'
    

    --change CHARACTER SET of DB to utf8

    ALTER DATABASE dbName CHARACTER SET utf8 COLLATE utf8_general_ci
    

提交回复
热议问题