MySQL 5.5 on Ubuntu 12.04 – Job Failed to Start

I migrated a web site from one host to another and as such upgraded to MySQL 5.5 running on Ubuntu 12.04. Everything was moving along nicely until MySQL started to randomly crash.

1
Jul 23 07:06:38 domU-12-31-39-02-76-EA kernel: [236645.626405] init: mysql main process (21515) terminated with status 1
2
Jul 23 07:06:38 domU-12-31-39-02-76-EA kernel: [236645.626453] init: mysql main process ended, respawning
3
Jul 23 07:06:39 domU-12-31-39-02-76-EA kernel: [236646.617559] init: mysql post-start process (21516) terminated with status 1
Trying to start the process using the service command yields this message:

1
Job failed to start
I found several sites recommending that I uninstall and re-install mysqld – which I did to no avail.

I finally tried to run mysqld manually from command line and found a bit more of a clue:

1
120723 7:40:29 [Note] Plugin ‘FEDERATED’ is disabled.
2
120723 7:40:29 InnoDB: The InnoDB memory heap is disabled
3
120723 7:40:29 InnoDB: Mutexes and rw_locks use GCC atomic builtins
4
120723 7:40:29 InnoDB: Compressed tables use zlib 1.2.3.4
5
120723 7:40:29 InnoDB: Initializing buffer pool, size = 128.0M
6
InnoDB: mmap(137363456 bytes) failed; errno 12
7
120723 7:40:29 InnoDB: Completed initialization of buffer pool
8
120723 7:40:29 InnoDB: Fatal error: cannot allocate memory for the buffer pool
9
120723 7:40:29 [ERROR] Plugin ‘InnoDB’ init function returned error.
10
120723 7:40:29 [ERROR] Plugin ‘InnoDB’ registration as a STORAGE ENGINE failed.
11
120723 7:40:29 [ERROR] Unknown/unsupported storage engine: InnoDB
12
120723 7:40:29 [ERROR] Aborting
13
120723 7:40:29 [Note] /usr/sbin/mysqld: Shutdown complete
Aha! Looks like something with the configuration of Innodb.

Checking some of these messages revealed that the default configuration for innodb_buffer_pool_size is 128M… for my small server this was simply too large.

From here, I simply modified /etc/mysql/my.cnf to include the following statement

1
innodb_buffer_pool_size = 16M
A much more reasonable number considering the size of my server memory. Now simply start your mysql server and you should be good to go!

坚持原创技术分享,您的支持将鼓励我继续创作!