mysql导入数据时产生:ERROR 1366 (HY000): Incorrect string value解决办法

执行以下命令:

SET names utf8mb4;

完事,问题解决!

验证修改结果:

SHOW VARIABLES WHERE Variable_name LIKE 'character\_set\_%' OR Variable_name LIKE 'collation%';
+--------------------------+--------------------+
| Variable_name            | Value              |
+--------------------------+--------------------+
| character_set_client     | utf8mb4            |
| character_set_connection | utf8mb4            |
| character_set_database   | utf8               |
| character_set_filesystem | binary             |
| character_set_results    | utf8mb4            |
| character_set_server     | latin1             |
| character_set_system     | utf8               |
| collation_connection     | utf8mb4_general_ci |
| collation_database       | utf8_general_ci    |
| collation_server         | latin1_swedish_ci  |
+--------------------------+--------------------+

你可能感兴趣的:(mysql,mysql)