mysql老是掛 mysql頻繁掛掉

2021-10-18 11:54:45 字數 954 閱讀 7050

通常來說就是你記憶體小了,如果不能擴記憶體,就用swap。

報錯資訊如下:

2020-04-22t05:18:18.840523z 0 [error] innodb: mmap(137428992 bytes) failed; errno 12

2020-04-22t05:18:18.840530z 0 [error] innodb: cannot allocate memory for the buffer pool

2020-04-22t05:18:18.840537z 0 [error] innodb: plugin initialization aborted with error generic error

2020-04-22t05:18:18.840544z 0 [error] plugin 'innodb' init function returned error.

2020-04-22t05:18:18.840548z 0 [error] plugin 'innodb' registration as a storage engine failed.

2020-04-22t05:18:18.840552z 0 [error] failed to initialize builtin plugins.

2020-04-22t05:18:18.840561z 0 [error] aborting

先把自己的mysql設定的低調一點:

innodb_buffer_pool_size = 64m

再加swap,步驟如下:

1) dd if=/dev/zero of=/swapfile bs=1m count=1024

2) mkswap /swapfile

3) swapon /swapfile

4) 新增這行: /swapfile swap swap defaults 0 0 到 /etc/fstab

重啟mysqld就好了,試試把。

mysql經常掛掉 mysql老是掛的問題

190629 10 44 21 error mysqld out of memory needed 128917504 bytes 190629 10 44 21 error mysqld out of memory needed 96681984 bytes 190629 10 44 23 inn...

mysql頻繁鎖邊原因排查 MySQL 碎片

檢視某個表所佔空間,以及碎片大小。select table name,engine,table rows,data length index length length,data free from information schema.tables where table schema test ...

mysql頻繁鎖邊原因排查 MySQL 碎片

檢視某個表所佔空間,以及碎片大小。select table name,engine,table rows,data length index length length,data free from information schema.tables where table schema test ...