现象:
Navicat正常连接
查询权限,检查无误
mysql> select user,host,password from mysql.user; +-------+------+-------------------------------------------+ | user | host | password | +-------+------+-------------------------------------------+ | root | % |XXX | | canal | % | XXX | +-------+------+-------------------------------------------+
java通过jdbc连接数据库,数据库正常读取连接,
接入mybatis无法连接数据库,用户名密码正确,报错权限不足
解决方案
重置下角色的用户名密码
use mysql update user set password=password(“新密码”) where user=“root”;flush privileges;exit