- 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
utf8mb4and DB collation toutf8mb4_bin - Or you can just edit
application/config/database.phplike this
$db['default'] = array(
# ...
'char_set' => 'utf8mb4',
'dbcollat' => 'utf8mb4_bin',
# ...
);$this->dbforge->create_table('messages', FALSE, array('CHARACTER SET' => 'utf8mb4', 'COLLATE' => 'utf8mb4_bin'));