博客間歇性報「Error Establishing a Database Connection」,重啟主機暫時恢復。日誌關鍵錯誤:
InnoDB: Fatal error: cannot allocate memory for the buffer pool
[ERROR] Plugin 'InnoDB' init function returned error
[ERROR] Unknown/unsupported storage engine: InnoDB
free -m 顯示 Swap 為 0innodb_buffer_pool_size=128M,啟動時申請大塊連續內存失敗/etc/my.cnf
[mysqld]
innodb_buffer_pool_size=64M
systemctl restart mariadbInitializing buffer pool, size = 64.0M ... Completed,free -m 顯示 Swap 1023M 可用。innodb_buffer_pool_size 應 ≤ 物理內存 50-70%tail /var/log/mariadb/mariadb.log 定位具體錯誤碼