An attempt by a client to checkout a Connection has timed out — 連接池獲取連接超時cpool.checkoutTimeout(500→18000→36000)、擴大maxPoolSize(100),無效Connections could not be acquired from the underlying database! — 底層數據庫無法獲取連接靈感來源:Oracle 11g默認密碼180天過期。MySQL 5.7+默認啟用default_password_lifetime=360(天),密碼過期後:
ERROR 1820 (HY000): You must reset your password)-- 以root登錄
ALTER USER 'app_user'@'%' IDENTIFIED BY 'new_password' PASSWORD EXPIRE NEVER;
FLUSH PRIVILEGES;
[mysqld]
default_password_lifetime = 0 -- 0表示永不過期
-- 或單用戶級別
ALTER USER 'app_user'@'%' PASSWORD EXPIRE NEVER;
SELECT user, host, password_expired, password_last_changed
FROM mysql.user WHERE user='app_user';
重啟MySQL與應用服務(Tomcat等),連接恢復正常。
password_expired='Y'用戶,提前30天告警my.cnf顯式設置default_password_lifetime=0教訓:連接池超時往往是症狀而非病因,向下穿透到數據庫錯誤日誌、狀態變量,才能定位真實根因。