欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

解決springboot 連接 mysql 時報錯 using password: NO的方案

 更新時間:2020年01月31日 10:35:04   作者:鬾鬽鬿魀魁䰡  
在本篇文章里小編給大家整理了關(guān)于解決springboot 連接 mysql 時報錯 using password: NO的方案,有需要的朋友們可以學習下。

最近使用 springboot 配置 mysql 時出現(xiàn)了一個錯誤

Access denied for user ''@'localhost' (using password: YES) 或者
Access denied for user ''@'localhost' (using password: NO)

經(jīng)發(fā)現(xiàn)這是 springboot 中 yml 語法的的一個坑,在我現(xiàn)在用的最新版本2.2.4 的springBoot中所推薦 yml 的格式是

data-username: root
data-password: 112233

就是前面加了 data- 的這種格式導致了這個錯誤,

單獨使用 data-username 報錯 using password: YES

如果使用 data-password 報錯 using password: NO

后來查看源碼發(fā)現(xiàn),對于 username 和 password 的參數(shù)有一句這樣的說明:Login username of the database./ Login password of the database.
而 data-username 和 data-password 的說明又有不同:

Username of the database to execute DML scripts (if different). / Password of the database to execute DML scripts (if different).
執(zhí)行DML腳本的數(shù)據(jù)庫的用戶名(如果有)。

到這里問題已經(jīng)很明顯了, 什么叫 "執(zhí)行DML腳本的數(shù)據(jù)庫的用戶名" 它和 "數(shù)據(jù)庫的登錄用戶名" 之間又有什么區(qū)別

<br><br>

以上就是本次介紹的全部相關(guān)知識點內(nèi)容,感謝大家的學習和對腳本之家的支持。

相關(guān)文章

最新評論