1.确保数据库的url地址,用户名以及密码、端口号没有错误
下面是我的application.yml文件代码:
mybatis:
config-location: classpath:mybatis/mybatiscfg.xml
mapper-locations: classpath:mybatis/mapper/*.xml
type-aliases-package: com.neu.vo
server:
port:9696
servlet:
context-path: /neu
spring:
application:
name: sm
datasource:
driver-class-name:com.mysql.jdbc.Driver
url: jdbc:mysql://localhost:3306/userdb?useUnicode=true&characterEncoding=utf8&useSSL=false
username: root
password: 123456
# 分页配置
pagehelper:
helper-dialect: mysql
reasonable: true
support-methods-arguments: true
params: count=countSql
2.自己的sql语句格式写错了吗?注意该有的空格!!!
网友评论