nacos後台報資料庫連線錯誤

2021-10-14 18:31:41 字數 518 閱讀 8603

現象

hikaripool-1 - failed to validate connection com.mysql.cj.jdbc.connectionimpl@17515ba4 (communications link failure

the last packet successfully received from the server was 1,763,413 milliseconds ago. the last packet sent successfully to the server was 1,763,414 milliseconds ago.). possibly consider using a shorter maxlifetime value.

原因因為nacos用的hikari預設的maxlifetime為30分鐘,mysql資料庫的wait_time預設為600秒,所以mysql資料庫先於hikari的連線池管理斷開了連線,導致連線失效。

解決辦法

修改mysql資料庫的wait_time,大於30分鐘即可。

資料庫連線錯誤

我在使用mysql8.0時出現的這個錯誤,解決方法為在配置檔案中的url後面新增上一句 allowpublickeyretrieval true。錯誤即可解決。我在使用spring框架運算元據庫時出現這個錯誤,錯誤原因可能是因為username,url等字段是mysql的關鍵字,所以解決方法是在這些...

Owncloud資料庫連線錯誤

在使用owncloud時,有時會出現資料庫連線錯誤,這一般是由於mysql使用者許可權錯誤引起的,我們需要把owncloud自己所建立使用者以及表全刪乾淨,從頭開始做,以下為解決方案。solution drop database select from mysql.user drop all the...

後台連線資料庫,前台返回資料

首先從github上clone下來的 安裝且配置過可以看到package.json裡面包含有了egg mysql的依賴。你只需要在config config.default.js裡面配置你需要訪問的mysql 你需要將下面的配置改成你的mysql位址 然後再更改路由配置 在controller資料夾...