# 数据库

## Incorrect string value: '\xE5\xB1\x9E\xE6\x80\xA7' for column

解决方法：更改数据库字段的字符集编码为utf-8

## mysql默认建表字符集格式

[更改MySQL数据库的编码为utf8mb4 - CSDN博客](https://blog.csdn.net/woslx/article/details/49685111)

## Data truncated for column 'id' at row 1

解决方法：检查下数据库列类型和项目中实体类的id类型是否一致。数据库id是int类型的，项目实体类是String类型的，项目save功能无法保存

## SQLException: The server time zone value '�й���׼ʱ��' is unrecognized

解决方法：加入时区serverTimezone=UTC

```
jdbc:mysql://localhost:3306/blog?useUnicode=true&characterEncoding=UTF8&serverTimezone=UTC
```

## mysql5.7转入5.5报错 The used table type doesn't support FULLTEXT indexes

原因：相对于mysql5.5，mysql5.7对某些字符做了变更，示例如下

| mysql5.7                   | mysql5.5                      |
| -------------------------- | ----------------------------- |
| DEFAULT CURRENT\_TIMESTAMP | DEFAULT '0000-00-00 00:00:00' |

解决方法：

参考：[mysql阿里云5.7转入5.5报错 The used table type doesn't support FULLTEXT indexes解决办法](https://www.cnblogs.com/sung/p/13581291.html)
