在线观看不卡亚洲电影_亚洲妓女99综合网_91青青青亚洲娱乐在线观看_日韩无码高清综合久久

鍍金池/ 問答/Java  網(wǎng)絡(luò)安全/ springboot 如何邂逅utf8mb4

springboot 如何邂逅utf8mb4

springboot中連接數(shù)據(jù)時想使用utf8mb4,不知配置文件application.properties中有沒有相關(guān)屬性可以配置呢?

Cannot store “Pile of Poo” unicode emoji using Spring Boot Hibernate and MySQL看到個yml 文件的配置,但發(fā)現(xiàn)有些屬性寫法與properties文件不太一樣。
yml 文件中:

spring:
datasource:
 driverClassName: com.mysql.jdbc.Driver
 connectionInitSqls: "SET NAMES utf8mb4 COLLATE utf8mb4_unicode_ci;"
jpa:
hibernate:
 connection:
     CharSet: utf8mb4

properties文件中,就知道

spring.datasource.driver-class-name=com.mysql.jdbc.Driver

其他的屬性是不是可以這樣對應(yīng)的寫:

spring.datasource.connectionInitSqls = "SET NAMES utf8mb4 COLLATE utf8mb4_unicode_ci;"
spring.jpa.hibernate.connection.CharSet=utf8mb4

還有像這些配置字段有沒有文檔可以查呢?

回答
編輯回答
初念

應(yīng)該是:

spring.datasource.connectionInitSqls = "SET NAMES utf8mb4 COLLATE utf8mb4_unicode_ci;"
jpa.hibernate.connection.CharSet=utf8mb4
2017年8月7日 00:29