(ERROR 1366 (HY000): Incorrect string value:'\xD5\xD4' for column 'name' at row

登录mysql -- >

进入相应的数据库 --->

输入:show variables like '%char%';

 

得道:

+--------------------------+--------------------------------------+

| Variable_name            | Value                                |

+--------------------------+--------------------------------------+

| character_set_client     | utf8                                 |

| character_set_connection | utf8                                 |

| character_set_database   | latin1                               |

| character_set_filesystem | binary                               |

| character_set_results    | utf8                                 |

| character_set_server     | latin1                               |

| character_set_system     | utf8                                 |

| character_sets_dir       | F:\SoftWare\mysql5.5\share\charsets\ |

+--------------------------+--------------------------------------+

 

如果出现上述情况需要更改编码数据库,有两种方法:第一种一次搞定,第二种只对当前连接有效,断开连接,回复原来状态

方法1: alter database 数据库名 charset utf-8;

方法2: set character_set_database = utf-8;

 

在使用: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     | latin1                               |

| character_set_system     | utf8                                 |

| character_sets_dir       | F:\SoftWare\mysql5.5\share\charsets\ |

 

+--------------------------+--------------------------------------+

你可能感兴趣的:((ERROR 1366 (HY000): Incorrect string value:'\xD5\xD4' for column 'name' at row)