0

I'm unable to start mysqld due to it being unable to allocate enough memory.

I've installed the DB using the defaults:

sudo mysql_install_db --user=mysql

Then when I try to start mysqld, I get this:

name@host:/var/lib/mysql$ sudo mysqld --user=mysql
110307 16:01:21 InnoDB: Error: cannot allocate 2097168384 bytes of
InnoDB: memory with malloc! Total allocated memory
InnoDB: by InnoDB 35494096 bytes. Operating system errno: 12
InnoDB: Check if you should increase the swap file or
InnoDB: ulimits of your operating system.
InnoDB: On FreeBSD check you have compiled the OS with
InnoDB: a big enough maximum process size.
InnoDB: Note that in most 32-bit computers the process
InnoDB: memory space is limited to 2 GB or 4 GB.
InnoDB: We keep retrying the allocation for 60 seconds...
InnoDB: Fatal error: cannot allocate the memory for the buffer pool
110307 16:02:21 [ERROR] Default storage engine (InnoDB) is not available
110307 16:02:21 [ERROR] Aborting

I haven't been able to find a way to increase ulimits though. The box has enough memory to mysql, so I assume it's just a problem with the mysql user?

I'm using a Xen VM.

Outspaced
  • 103
  • 1
  • 4

1 Answers1

2

I would guess from the error message and that since 2097168384 is suspiciously close to 2^31 you are running on a 32-bit system. Try reducing the amount of memory used by InnoDB in my.cnf, particularily innodb_buffer_pool_size, and see if that allows MySQL to start.

See also the warning towards the bottom on the MySQL InnoDB Configuration page about exceeding 2GB.

uesp
  • 3,414
  • 1
  • 18
  • 16