解决springboot中保存localdatatime类型到mysql报错
报错xception in thread "main" com.mysql.jdbc.MysqlDataTruncation: Data truncation: Incorrect date value: '\xAC\xED\x00\x05sr\x00\x0Djava.time.Ser\x95]\x84\xBA\x1B"H\xB2\x0C\x00\x00xpw\x07\x03\x00\x00\x07\xE0\x0B\x0Dx' for column 't_date' at row 1
如果想要在JDBC中,使用Java8的日期LocalDate、LocalDateTime,则必须要求数据库驱动的版本不能低于4.2,
如果你使用的mysql-connector-java版本低于5.1.37,则数据库的驱动版本低于4.2
在pom文件中做如下配置ok

浙公网安备 33010602011771号