spring data jpa utf-8 encoding not working

Try

spring.datasource.url = jdbc:mysql://localhost:3306/gehive?useUnicode=yes&characterEncoding=UTF-8

It seems issue is due to missing "-".

Reference:- https://forum.hibernate.org/viewtopic.php?f=1&t=1037497&view=next


I had the same issues, and I solved it by adding this line to my application.properties file:

spring.datasource.tomcat.connection-properties=useUnicode=true;characterEncoding=utf-8;

Note: The following didn't work:

spring.datasource.connectionProperties=useUnicode=true;characterEncoding=utf-8;