美文网首页
SpringBoot操作数据库失败

SpringBoot操作数据库失败

作者: 如宙 | 来源:发表于2020-11-27 19:41 被阅读0次

    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语句格式写错了吗?注意该有的空格!!!

    相关文章

      网友评论

          本文标题:SpringBoot操作数据库失败

          本文链接:https://www.haomeiwen.com/subject/prkgiktx.html