I'm struggling inserting Unicode character like Chinese character into Mysql table.
The stack is Spring Data JPA and Mysql.
The method I have tried:
1, Set spring.datasource.url to support utf-8 by modifying application.properties
spring.jpa.hibernate.ddl-auto=update
spring.datasource.url=jdbc:mysql://localhost:3306/mydb?useUnicode=true&characterEncoding=UTF-8
spring.datasource.tomcat.connection-properties=useUnicode=true;characterEncoding=utf-8
connection.useUnicode=true
connection.characterEncoding=utf-8
hibernate.connection.useUnicode=true
hibernate.connection.characterEncoding=UTF-8
spring.datasource.sqlScriptEncoding=UTF-8
spring.datasource.driver-class-name=com.mysql.jdbc.Driver
spring.http.encoding.charset=UTF-8
spring.http.encoding.enabled=true
spring.http.encoding.force=true
spring.jpa.show-sql = true
2, Set IDE eclipse to use utf-8 as encode method.
3, Set variable of mysql through my.ini and current mysql charset variables are like following:
However, when I tried to select all content of the table by mysql
command line tool, the content of table is just messy with a sequence of question mark.
Any thing I missed?