mysql在服务器上导入后停止

大家好,今天晚上我已经导入到我的服务器(服务器与Linux的512Mb Ram),是一个非常大的数据库与Magento(电子商务)的import。 当我打开我的网站的MySQL不起作用,我已经看到,在服务器服务停止,停下来。 我已经重新启动所有的Apache 2和内存caching,现在工作。 但我想知道为什么MySQL被停止。 在/var/log/mysql/error.log我创build了这一行:

InnoDB: Progress in percents: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52$ InnoDB: Rolling back of trx id 1CA46C3 completed 130126 14:29:58 InnoDB: Rollback of non-prepared transactions completed 130128 6:05:51 [Note] Plugin 'FEDERATED' is disabled. 130128 6:05:59 InnoDB: The InnoDB memory heap is disabled 130128 6:05:59 InnoDB: Mutexes and rw_locks use GCC atomic builtins 130128 6:05:59 InnoDB: Compressed tables use zlib 1.2.3.4 130128 6:06:11 InnoDB: Initializing buffer pool, size = 128.0M 130128 6:06:19 InnoDB: Completed initialization of buffer pool 130128 6:11:51 [Note] Plugin 'FEDERATED' is disabled. 130128 6:12:01 InnoDB: The InnoDB memory heap is disabled 130128 6:12:01 InnoDB: Mutexes and rw_locks use GCC atomic builtins 130128 6:12:01 InnoDB: Compressed tables use zlib 1.2.3.4 130128 6:12:19 InnoDB: Initializing buffer pool, size = 128.0M InnoDB: mmap(137363456 bytes) failed; errno 12 130128 6:12:23 InnoDB: Completed initialization of buffer pool 130128 6:12:23 InnoDB: Fatal error: cannot allocate memory for the buffer pool 130128 6:12:28 [ERROR] Plugin 'InnoDB' init function returned error. 130128 6:12:29 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed. 130128 6:12:30 [ERROR] Unknown/unsupported storage engine: InnoDB 130128 6:12:30 [ERROR] Aborting 130128 6:12:32 [Note] /usr/sbin/mysqld: Shutdown complete 130128 6:21:04 [Note] /usr/sbin/mysqld: Shutdown complete 130128 6:21:03 [Note] Plugin 'FEDERATED' is disabled. 130128 6:21:03 InnoDB: The InnoDB memory heap is disabled 130128 6:21:03 InnoDB: Mutexes and rw_locks use GCC atomic builtins 130128 6:21:03 InnoDB: Compressed tables use zlib 1.2.3.4 130128 6:21:03 InnoDB: Initializing buffer pool, size = 128.0M InnoDB: mmap(137363456 bytes) failed; errno 12 130128 6:21:03 InnoDB: Completed initialization of buffer pool 130128 6:21:03 InnoDB: Fatal error: cannot allocate memory for the buffer pool 130128 6:21:03 [ERROR] Plugin 'InnoDB' init function returned error. 130128 6:21:03 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed. 130128 6:21:03 [ERROR] Unknown/unsupported storage engine: InnoDB 130128 6:21:03 [ERROR] Aborting 130128 6:21:04 [Note] /usr/sbin/mysqld: Shutdown complete 

你能帮我find问题吗? 这行可以用来理解这个问题吗?

正如评论中所build议的那样,您应该安装任何监控软件。

如果您的问题再次发生,您将能够找出原因。

请注意,有些人有相同的问题,并通过添加交换解决它。

首先,我不太可能想象为什么你只用512MB的RAM来运行一个Magento商店 – 这是一个灾难的秘诀 。

130128 6:21:03 InnoDB:致命错误:无法为缓冲池分配内存

这是两件事情之一。

你已经在 my.cnf 分配了内存

如果你已经从互联网上拷贝了一个“优化的”Magento MySQLconfiguration文件,而不需要注意你的硬件和OP的硬件的区别,这将不会是一个惊喜。

你可以通过执行来validation,

 mysql> show variables like 'innodb_buffer%'; 

如果这个数字超过了你的RAM数量,那么在你的MySQLconfiguration文件/etc/mysql/my.cnf/etc/my.cnf减less它,然后重新启动MySQL。

你被 ulimit 限制了

即使你的MySQLconfiguration在可接受的内存限制之内 – 你可能会受到服务器设置的限制。

你可以通过执行来validation,

 ulimit -a 

并检查virtual memorymax memory size 。 通过执行来testing它

 ulimit -v unlimited ulimit -m unlimited 

然后启动MySQL

 /etc/init.d/mysql start