我正在尝试将数据插入mysql数据库,但收到错误:
1366, "Incorrect string value: \'\\\\xF0\\\\x9F\\\\x93\\\\x88Ge...\' for column \'some_column\' at row 160
我检查了
mysql> show variables like 'char%';
+--------------------------+--------------------------------------------------------+
| Variable_name | Value |
+--------------------------+--------------------------------------------------------+
| character_set_client | utf8 |
| character_set_connection | utf8 |
| character_set_database | utf8 |
| character_set_filesystem | binary |
| character_set_results | utf8 |
| character_set_server | utf8 |
| character_set_system | utf8 |
| character_sets_dir | /usr/local/mysql-5.6.27-osx10.8-x86_64/share/charsets/ |
并且
mysql> show variables like '%colla%';
+----------------------+-----------------+
| Variable_name | Value |
+----------------------+-----------------+
| collation_connection | utf8_unicode_ci |
| collation_database | utf8_unicode_ci |
| collation_server | utf8_unicode_ci |
+----------------------+-----------------+
我正在使用SqlAlchemy,同时设置encoding = utf8。 我创建了表格:
ENGINE = InnoDB
DEFAULT CHARACTER SET = utf8
COLLATE = utf8_unicode_ci;
有人可以请一些建议我还应该做些什么吗?