-
-
Save dinks/a2b4acbdc738f28ed010 to your computer and use it in GitHub Desktop.
Fix MySQL issue "Fatal error: cannot allocate memory for the buffer pool" on Digital Ocean server
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Check swap | |
$ sudo swapon -s | |
Filename Type Size Used Priority --> empty | |
// Create and enable swap file | |
$ sudo dd if=/dev/zero of=/swapfile bs=1024 count=512k | |
$ sudo mkswap /swapfile | |
Setting up swapspace version 1, size = 262140 KiB | |
no label, UUID=103c4545-5fc5-47f3-a8b3-dfbdb64fd7eb | |
// Activate swap | |
$ sudo swapon /swapfile | |
// View swap summary | |
$ swapon -s | |
Filename Type Size Used Priority | |
/swapfile file 262140 0 -1 | |
$ echo 0 | sudo tee /proc/sys/vm/swappiness | |
// Set swap file permission | |
$ sudo chown root:root /swapfile | |
$ sudo chmod 0600 /swapfile | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment