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

解決springboot 連接 mysql 時(shí)報(bào)錯(cuò) using password: NO的方案

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

最近使用 springboot 配置 mysql 時(shí)出現(xiàn)了一個(gè)錯(cuò)誤

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

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

data-username: root
data-password: 112233

就是前面加了 data- 的這種格式導(dǎo)致了這個(gè)錯(cuò)誤,

單獨(dú)使用 data-username 報(bào)錯(cuò) using password: YES

如果使用 data-password 報(bào)錯(cuò) using password: NO

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

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

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

<br><br>

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

相關(guān)文章

最新評(píng)論