当前位置:Gxlcms > 数据库问题 > springboot项目前端页面中文搜索时,数据库查询为空(mysql)

springboot项目前端页面中文搜索时,数据库查询为空(mysql)

时间:2021-07-01 10:21:17 帮助过:37人阅读

在application配置文件中数据库的url最后加上 ?characterEncoding=utf8 即可解决

#配置数据库
spring: 
  datasource: 
    driver-class-name: com.mysql.jdbc.Driver
    url: jdbc:mysql://localhost:3306/jeff?characterEncoding=utf8
    username: root
    password: mysql

springboot项目前端页面中文搜索时,数据库查询为空(mysql)

标签:前端   har   enc   app   mys   中文   pass   项目   配置   

人气教程排行