1. 打开idea依次点击File Settings Editor Inspections SQL2.在SQL下找到 No data sources configured 和 SQL dialect detection 取消勾选记得Apply保存3.有些版本idea还需要以下步骤File Settings Editor Color Scheme General Code Injected language fragment Background背景色取消勾选大功告成