No data source are configured to run this SQL and provide advanced code assistance.
作者:mmseoamin日期:2023-12-11

在springboot项目中在resource文件夹中编写database.sql时,在显示框顶部显示如下提示:

No data source are configured to run this SQL and provide advanced code assistance.

SQL dialect is not configured. MariaDB,MySQL match best.

具体如截图所示:

No data source are configured to run this SQL and provide advanced code assistance.,在这里插入图片描述,第1张

解决办法:

一、先解决第二个,也就是“SQL dialect is not configured. MariaDB,MySQL match best.”这个问题:

1、进入settings—>Editor—>Inspections

2、在搜索栏中输入sql,找到:SQL dialect detection

3、去掉勾选,点击Apply,点击OK

4、这时会发现第二条提示(SQL dialect is not configured. MariaDB,MySQL match best.)已经不显示了

No data source are configured to run this SQL and provide advanced code assistance.,在这里插入图片描述,第2张

二、解决第一个,这里以连接MySQL为例

1、点击idea后边菜单栏中的Database

2、在弹出的页面中点击“+”—>Data Source—>MySQL

3、在弹出的页面中不用填写任何信息,直接点击Apply—>OK即可,原因:mysql的连接application.properties或application.yml中配置,这里不填写不影响项目的启动

No data source are configured to run this SQL and provide advanced code assistance.,在这里插入图片描述,第3张

No data source are configured to run this SQL and provide advanced code assistance.,在这里插入图片描述,第4张