1.啟動(dòng)MySQL時(shí)一直不成功,查看錯(cuò)誤日志 /var/log/mysql/error.log
2.主要的錯(cuò)誤信息有如下幾條:
[ERROR] InnoDB: mmap(136151040 bytes) failed; errno 12[ERROR] InnoDB: Cannot allocate memory for the buffer pool[ERROR] InnoDB: Plugin initialization aborted with error Generic error[ERROR] Plugin 'InnoDB' init function returned error.[ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.[ERROR] Failed to initialize plugins.[ERROR] Aborting
3.查詢(xún)后是因?yàn)閮?nèi)存不足,查看內(nèi)存
增加swap交換空間解決問(wèn)題:
dd if=/dev/zero of=/swapfile bs=1M count=1024mkswap /swapfileswapon /swapfile
4.增加自動(dòng)掛載:
在文件/etc/fstab中加入 /swapfile swap swap defaults 0 0
service mysql start 啟動(dòng)成功
5. 備注:
生成空文件
dd if=/dev/zero of=1.txt bs=1M count=2 生成一個(gè)指定大小的空文件if=文件名:輸入文件名of=文件名:輸出文件名bs=字節(jié)大小count=個(gè)數(shù)
總結(jié)
以上所述是小編給大家介紹的MySQL常見(jiàn)內(nèi)存不足啟動(dòng)失敗的完美解決方法,希望對(duì)大家有所幫助,如果大家有任何疑問(wèn)請(qǐng)給我留言,小編會(huì)及時(shí)回復(fù)大家的。在此也非常感謝大家對(duì)VeVb武林網(wǎng)網(wǎng)站的支持!
新聞熱點(diǎn)
疑難解答
圖片精選