文章目錄
- 一、Mybaits
- 1.1 SQL dialect is not configured
- 二、MySQL
- 2.1 idea連接資料庫
- 2.2 idea Unable to resolve table
一、Mybaits
1.1 SQL dialect is not configured
問題:在xxxMapper.xml會遇到如下問題:
SQL dialect is not configured. MySQL, BigQuery, MariaDB match best.
解決:

根據使用的資料庫,修改SQL Dialect,博主這里修改為MySQL,

同理,也可以在這里修改整個idea或是整個專案的資料庫,

二、MySQL
2.1 idea連接資料庫
點擊右側工具視窗Database(默認在右邊欄,如果關掉了,可以在view設定中打開)

分別填寫用戶名和密碼,也可填寫資料庫(mysql)中某一個資料庫(database)的名稱,

可以看到博主這里有8個資料庫(database)

對于只使用一個資料庫的專案,建議直接選定該資料庫(database),選擇方法見2.2,
2.2 idea Unable to resolve table
問題:在確保資料庫連接正常,資料庫中確實存在該表,sql陳述句拼寫正確時出現一下錯誤,
idea Unable to resolve table
解決方法一:全限定名
輸入全限定表名,例如指定test_db下的student表
select * from test_db.student;
解決方法二:為專案設定DataSource
點擊右側工具視窗Database(默認在右邊欄,如果關掉了,可以在view設定中打開),然后點擊Datasource Properties按鈕,為專案指定Database即可,

轉載請註明出處,本文鏈接:https://www.uj5u.com/qita/330173.html
標籤:其他
