mysql 修改密码数据源无法连接

AndsionLee 2016-03-31 12:29:13
刚修改了mysql数据库root密码,linux命令行,navcat都可以正常连接。但是java代码里的数据源报
Request processing failed; nested exception is org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.exceptions.PersistenceException: \n### Error querying database. Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC Connection; nested exception is java.sql.SQLException: Access denied for user 'root'@'localhost' (using password: YES)\n### The error may exist in file [/home/hxs/app/api/WEB-INF/classes/mapper/userMapper.xml]\n### The error may involve net.znzkj.hxs.api.dao.UserMapper.queryUserByUserName\n### The error occurred while executing a query\n### Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC Connection; nested exception is java.sql.SQLException: Access denied for user 'root'@'localhost' (using password: YES)" 我确定数据源密码都修改正确。
...全文
188 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
renwotao2009 2016-03-31
  • 打赏
  • 举报
回复
建议命令刚下链接下mysql,另外修改root密码时注意使用sql命令 通过登录mysql系统, # mysql -uroot -p Enter password: 【输入原来的密码】 mysql>use mysql; mysql> update user set password=passworD("test") where user='root'; mysql> flush privileges; mysql> exit;
X-i-n 2016-03-31
  • 打赏
  • 举报
回复
在shell里和navicat里连接以后,随便执行一条表查询看看能不能成功。

19,613

社区成员

发帖
与我相关
我的任务
社区描述
系统使用、管理、维护问题。可以是Ubuntu, Fedora, Unix等等
社区管理员
  • 系统维护与使用区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧