How Did I: Fix The InnoDB memory heap is disabled in mySQL on Amazon EC2

InnoDB memory heap is disabled in mySQL is an annoying issue that occurs pretty often when you install mySQL on Amazon EC2 server, especially when you use it for WordPress. Let’s now look at why this error happens and how we could trouble shoot it.

Why the error happens?

The error mainly happens due to the insufficient memory on the heap for the mySQL on EC2. The Amazon EC2’s micro instance gives us just 613MB of memory and mySQL can’t take all of the memory for itself.

How to kill this issue?

The solution that works best is to create a swap memory for mySQL and allow the applications to take advantage of that. Here’s how to do that:

  1. Login into your instance from Terminal or Command Prompt via SSH.
  2. Now, switch to Root mode (Sudo su)
  3. Run the following command: dd if=/dev/zero of=/swapfile bs=1M count=1024
  4. Make a swap file by running: mkswap /swapfile 
  5. Turn on Swap Files: swapon /swapfile

And that’s it. You’re done. To monitor your Swap file size and free space, just type swapon -s.

Hope this helps.

  • Invtr

    Easier way to fix it is; innodb_use_sys_malloc =1 walla without doing dd 🙂

  • Thank you so much. This resolved a great deal of errors for me

    • Nice to know that you resolved the issue. 🙂

Subscribe to 4CAST

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Join 23 other subscribers