> ## Content Index
> Fetch the complete content index at: https://ostreff.info/llms.txt
> Use this file to discover other available public pages before exploring further.

# How-to fix Illegal mix of collations errors in mysql
- URL: https://ostreff.info/how-to-fix-illegal-mix-of-collations-errors-in-mysql/
- Published: 2021-01-27T18:26:13.000Z
- Updated: 2021-02-05T22:01:18.000Z
- Author: Jordan Ostreff
- Tags: MySQL, Postfix

If you have errors like my example bellow into your postfix logs - you can fix them easy :

`warning: mysql:/usr/local/etc/postfix/mysql_virtual_alias_maps.cf: query failed: Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (utf8mb4_unicode_ci,COERCIBLE) for operation '='`

Get the information(status) about all tables in the specific database using command like:

```
SHOW TABLE STATUS FROM your_db_name;
```

![](https://ostreff.info/content/images/2021/02/image.png)

example output

Then change your database collation to UTF8 is my recommendation using command like that:  
`ALTER DATABASE your_db_name CHARACTER SET utf8 COLLATE utf8_general_ci;`

Then to change all your tables listed from status command execute multiple times:  
`ALTER TABLE your_tablename_which_is_not_utf8 CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;`