亚洲国产日韩欧美一区二区三区,精品亚洲国产成人av在线,国产99视频精品免视看7,99国产精品久久久久久久成人热,欧美日韩亚洲国产综合乱

java - Spring operation database displays garbled Chinese characters?
我想大聲告訴你
我想大聲告訴你 2017-05-16 13:29:37
0
1
644

Operating system: ubuntu
IDE:idea
Database: Mysql
When I use php to operate the database, there is no problem with Chinese display, and Chinese can be displayed normally:

But when I was learning spring and operating the database, question marks would appear in Chinese and could not be displayed normally

The database configuration I wrote in spring

# 在項目初始化時,重新創(chuàng)建數(shù)據(jù)表
spring.jpa.hibernate.ddl-auto=update
# 指定連接的類型為mysql 連接的地址為:localhost 端口為3306 ,數(shù)據(jù)為springmvc
spring.datasource.url=jdbc:mysql://localhost:3306/springmvc
# 用戶名為root
spring.datasource.username=root
# 密碼為空
spring.datasource.password=
# 顯示SQL語句
spring.jpa.show-sql=true

My database and idea are both encoded in utf_8. Why does this problem occur?

我想大聲告訴你
我想大聲告訴你

reply all(1)
習(xí)慣沉默

Modification

spring.datasource.url=jdbc:mysql://localhost:3306/springmvc

for

spring.datasource.url=jdbc:mysql://localhost:3306/springmvc?useUnicode=true&characterEncoding=utf-8
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template