MyBB Community Forums

Full Version: wrong encoding after restoring mysql backup
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I have two servers on FreeBSD 12.0
MyBB 1.8.21
PHP 7.2.20 (on second 7.2.24)
MySQLi 5.7.26 (on second MySQLi 5.7.27)

I make db backup or from AdminCP or with mysqldump 
mysqldump --add-drop-database --add-drop-table --compatible=postgresql --create-options --set-gtid-purged=off --dump-date --databases mybb -u mybb-user --password=$MYSQL_PASSWD > /usr/home/ishayahu/backups/forum.sql

And try to restore backup on second server with fresh installation of mybb:


mysql -uroot --password=$MYSQL_PASSWD < /home/ishayahu/backups/usr/home/ishayahu/forum.sql

while on first server I've got correct UTF-8, second have some encoding error (like Вопросы по работе) (even in header and html encoding is set to utf8)
If I manualy change name to correct - it works


to solve it you should add to my.cnf:


[client]
...
default-character-set = utf8mb4
[mysqld]
...
character-set-client-handshake = FALSE
character-set-server = utf8mb4
collation-server = utf8mb4_unicode_ci