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

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

在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.
具体如截图所示:

解决办法:
一、先解决第二个,也就是“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.)已经不显示了

二、解决第一个,这里以连接MySQL为例
1、点击idea后边菜单栏中的Database
2、在弹出的页面中点击“+”—>Data Source—>MySQL
3、在弹出的页面中不用填写任何信息,直接点击Apply—>OK即可,原因:mysql的连接application.properties或application.yml中配置,这里不填写不影响项目的启动


转载请说明出处内容投诉
CSS教程_站长资源网 » No data source are configured to run this SQL and provide advanced code assistance.

发表评论

欢迎 访客 发表评论

一个令你着迷的主题!

查看演示 官网购买