title: MySQL InnoDB: mmap(137363456 bytes) failed; errno 12
body: <p>The problem started on a Amazon EC2 micro instance (1 GB ram), running a Wordpress website.</p>
  
  <p>I have tried several solutions on the internet but failed to solve the problem.</p>
  
  <p>Here is my MySQL error log:</p>
  
  <pre><code>160503 19:49:22 [Note] /usr/libexec/mysql55/mysqld (mysqld 5.5.46) starting as process 24829 ...
  160503 19:49:22 [Note] Plugin 'FEDERATED' is disabled.
  160503 19:49:22 InnoDB: The InnoDB memory heap is disabled
  160503 19:49:22 InnoDB: Mutexes and rw_locks use GCC atomic builtins
  160503 19:49:22 InnoDB: Compressed tables use zlib 1.2.8
  160503 19:49:22 InnoDB: Using Linux native AIO
  160503 19:49:25 InnoDB: Initializing buffer pool, size = 128.0M
  InnoDB: mmap(137363456 bytes) failed; errno 12
  160503 19:49:25 InnoDB: Completed initialization of buffer pool
  160503 19:49:25 InnoDB: Fatal error: cannot allocate memory for the buffer pool
  160503 19:49:25 [ERROR] Plugin 'InnoDB' init function returned error.
  160503 19:49:25 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
  160503 19:49:25 [ERROR] Unknown/unsupported storage engine: InnoDB
  160503 19:49:25 [ERROR] Aborting
  
  160503 19:49:27 [Note] /usr/libexec/mysql55/mysqld: Shutdown complete
  
  160503 19:49:29 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
  </code></pre>
  
  <p>The error suggests my server doesn't have enough memory.</p>
  
  <p>The error log is pretty similar to this one: <a href="https://stackoverflow.com/questions/10284532/amazon-ec2-mysql-aborting-start-because-innodb-mmap-x-bytes-failed-errno-12">Amazon EC2, mysql aborting start because InnoDB: mmap (x bytes) failed; errno 12</a></p>
  
  <p>I tried to create the swap file, restarted the mysql server, and the result was that it only took 2~ min longer to crash.</p>
  
  <p>I decided to create a medium instance with 4 GB RAM. I start the server and after clicking on 4~5 pages, the MySQL database crashes the same way, with the same error.</p>
  
  <p>The last Wordpress (4.5.1) update changed the database, not sure if it might be related... </p>
  
  <p>Any suggestions?</p>