- Set your database collation to
utf8mb4_bin
- Set your table collation to
utf8mb4_bin
- Source: https://stackoverflow.com/a/39465494/7800523
- Set the character set into
utf8mb4
and DB collation toutf8mb4_bin
- Or you can just edit
application/config/database.php
like this
$db['default'] = array(
# ...
'char_set' => 'utf8mb4',
'dbcollat' => 'utf8mb4_bin',
# ...
);
$this->dbforge->create_table('messages', FALSE, array('CHARACTER SET' => 'utf8mb4', 'COLLATE' => 'utf8mb4_bin'));