由于无法分配内存,无法启动mysqld

由于无法分配足够的内存,我无法启动mysqld。

我已经使用默认值安装了数据库:

sudo mysql_install_db --user=mysql

然后当我尝试启动mysqld,我得到这个:

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

尽pipe如此,我还是无法find增加限制的方法。 该框有足够的内存给MySQL,所以我认为这只是与MySQL用户的问题?

我正在使用Xen虚拟机。

我会从错误消息中猜测,并且由于2097168384可疑接近2 ^ 31,因此您正在32位系统上运行。 尝试减lessInnoDB在my.cnf中使用的内存量,特别是innodb_buffer_pool_size ,看看是否允许MySQL启动。

另请参阅MySQL InnoDBconfiguration页面底部的警告,超过2GB。