Mapper文件提示:No data sources are configured to run this sql的错误

问题描述:

我在启动tomcat后访问项目。可以正常访问,但是在需要读取数据库的数据时发现了错误,截图如下

Mapper文件提示:No data sources are configured to run this sql的错误

需要IDEA配置连接数据库

1.

Mapper文件提示:No data sources are configured to run this sql的错误

2.点添加,找到Data Source 找MySQL

Mapper文件提示:No data sources are configured to run this sql的错误

3.添加 database 还有 username password 之类的。最后可能会提示你安装一下 ,通过connection.jar 的包安装了某个东西,然后test connection 一下 就好了。

Mapper文件提示:No data sources are configured to run this sql的错误

4.如果上面配置好后,还出现  SQL dialect is not configured. SQL Server, Redshift, PostgreSQL match best 的提示,其实不是错误,你去搜一下怎么不显示这个就好了。我搜一下吧,偷个图过来,方便一次性解决。

Mapper文件提示:No data sources are configured to run this sql的错误

偷的图:(尊重作者,附上作者的连接....传送门:https://blog.****.net/****_1234567/article/details/78124051)

Mapper文件提示:No data sources are configured to run this sql的错误