我使用Hibernate生成模式和表。它将排序规则设置为latin1_swedish_ci。
如何将其更改为UTF8-general-ci?
application.properties文件:
#jdbc
spring.jpa.hibernate.ddl-auto=create
jdbc.driverClassName=com.mysql.jdbc.Driver
jdbc.url=jdbc:mysql://127.0.0.1:3306/tutor?createDatabaseIfNotExist=true&useUnicode=yes&characterEncoding=UTF-8
jdbc.user=root
jdbc.password=
# hibernate.X
hibernate.dialect=org.hibernate.dialect.MySQL5DBDialect
hibernate.show_sql=false
spring.jpa.generate-ddl=true
pool.size=2
#hibernate.hbm2ddl.auto=create-drop发布于 2019-03-10 14:06:03
像这样
jdbc:mysql://localhost/yourdatabase?UseUnicode=true&characterEncoding=utf8这是utf8,不是utf-8
https://stackoverflow.com/questions/55084702
复制相似问题