idea运行mybatis出现Exception in thread “main“ org.apache.ibatis.exceptions.PersistenceException等相关问题解决方案

Exception in thread “main” org.apache.ibatis.exceptions.PersistenceException
1.首先关注目录src/main/resources文件夹下的SqlMapConfig.xml文件
在这里插入图片描述
如果你的mysql时8.0以上的版本,有两个地方需要修改:
在这里插入图片描述
MySQL 8.0 以上版本 - JDBC 驱动名及数据库 URL:

com.mysql.cj.jdbc.Driver
和
jdbc:mysql://localhost:3306/runoob?useSSL=false&serverTimezone=UTC
注意:因为xml文件中,为避免错误的解析,&符号实际用&来表示

在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/weixin_44517301/article/details/113738903