报错如下:
2017-11-19 15:13:40.009 ERROR 15152 --- [nio-8090-exec-2] e.n.y.o.service.LoginModuleService : checkUserInfo: Error message is org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.exceptions.PersistenceException:
application.properties配置如下:
server.port = 8090
spring.mvc.view.prefix = /WEB-INF/jsp/
spring.mvc.view.suffix = .jsp
spring.datasource.driverClassName = com.mysql.jdbc.Driver
spring.datasource.url = jdbc:mysql://localhost:3306/onlinebookstore?useUnicode=true&characterEncoding=utf8&useSSL=false
spring.datasource.username = root
spring.datasource.password = root
mybatis.typeAliasesPackage = edu.javaee.onlinebookstore.domain
mybatis.config-location = classpath:mybatis/mybatis-config.xml
mybatis.mapper-locations = classpath:mybatis/mapper/*Mapper.xml
logging.file = log/service.log
检查过数据库密码正确,可以通过Navicat访问。
是因为mysql版本太高而连接驱动太低的原因 安装旧版本的mysql版本就解决了 中间尝试换了一个mysql高版本驱动 又报出来 版本编译问题 是因为 jdk版本太低导致的
update user set password=PASSWORD("123456") where user='root';
用navicat连接数据库重设一下数据库的登录密码。然后重启mysql服务。再试试。
Access denied for user 'root'@'localhost' (using password: YES)
这是密码不符啊, 你瞅瞅你本地mysql有密码不,密码是什么?
1 密码不正确
2 用户权限配置不正确