您的位置:首页 > 编程语言 > Java开发

关于java.sql.SQLException: Access denied for user 'root'@'localhost' (using password: YES)问题解决

2017-06-05 14:41 1016 查看
今天使用mybatis框架进行数据库访问时,出现:

org.apache.ibatis.exceptions.PersistenceException: 

### Error querying database.  Cause: java.sql.SQLException: Access denied for user 'root'@'localhost' (using password: YES)

### The error may exist in config/mapper/user.xml

### The error may involve test.findUserById

### The error occurred while executing a query

### Cause: java.sql.SQLException: Access denied for user 'root'@'localhost' (using password: YES)

。。。

的错误,查看网上的解决方案,大概分成两种:一种是数据库访问出现了问题;一种是编码的问题。

经过检验,我的数据库访问是没有问题的,仔细查看代码,发现配置文件中数据库的密码写错了!以此谨记自己的错误。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  数据库 mybatis
相关文章推荐