[Bug] 数据库从阿里云传输到内网可能会出现数据库访问异常
现象
内网魔方新建项目-导入例程页面,Java端报错
org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.exceptions.PersistenceException:
### Error querying database. Cause: com.baomidou.mybatisplus.core.exceptions.MybatisPlusException:
Error: Method queryTotal execution error of sql :
分析定位
分析到是在执行mapper getTemplates 时发生的问题,通过执行mybatis mapper里的脚本,DBeaver 报错,发现是调用IS_SET_INCLUDED函数时报错;
execute command denied to user 'fmshmicroservice'@'%' for routine 'fmsh_microservice_mfang.IS_SET_INCLUDED'
解决方法
在执行下列语句后,访问正常
GRANT ALL PRIVILEGES ON *.* TO 'fmshmicroservice'@'%';
FLUSH PRIVILEGES;