Mysql占用所有RAM并最终断开连接。它工作了大约一天。大约早上7点,它会下降。关于如何解决这个问题的任何指示都非常感谢。
mysql error.log文件:
170912 7:52:56 [Note] Plugin 'FEDERATED' is disabled.
170912 7:52:56 InnoDB: The InnoDB memory heap is disabled
170912 7:52:56 InnoDB: Mutexes and rw_locks use GCC atomic builtins
170912 7:52:56 InnoDB: Compressed tables use zlib 1.2.8
170912 7:52:56 InnoDB: Using Linux native AIO
170912 7:52:56 InnoDB: Initializing buffer pool, size = 300.0M
170912 7:52:56 InnoDB: Completed initialization of buffer pool
170912 7:52:56 InnoDB: highest supported file format is Barracuda.
InnoDB: Log scan progressed past the checkpoint lsn 4603050230
170912 7:52:56 InnoDB: Database was not shut down normally!
InnoDB: Starting crash recovery.
InnoDB: Reading tablespace information from the .ibd files...
InnoDB: Restoring possible half-written data pages from the doublewrite
InnoDB: buffer...
InnoDB: Doing recovery: scanned up to log sequence number 4603057481
170912 7:52:57 InnoDB: Starting an apply batch of log records to the database...
InnoDB: Progress in percents: 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 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99
InnoDB: Apply batch completed
170912 7:52:57 InnoDB: Waiting for the background threads to start
170912 7:52:58 InnoDB: 5.5.55 started; log sequence number 4603057481
170912 7:52:58 [Note] Server hostname (bind-address): '127.0.0.1'; port: 3306
170912 7:52:58 [Note] - '127.0.0.1' resolves to '127.0.0.1';
170912 7:52:58 [Note] Server socket created on IP: '127.0.0.1'.
170912 7:52:58 [Note] Event Scheduler: Loaded 0 events
170912 7:52:58 [Note] /usr/sbin/mysqld: ready for connections.
Version: '5.5.55-0+deb8u1-log' socket: '/var/run/mysqld/mysqld.sock' port: 3306 (Debian)
170912 7:53:06 [Note] Plugin 'FEDERATED' is disabled.
170912 7:53:06 InnoDB: The InnoDB memory heap is disabled
170912 7:53:06 InnoDB: Mutexes and rw_locks use GCC atomic builtins
170912 7:53:06 InnoDB: Compressed tables use zlib 1.2.8
170912 7:53:06 InnoDB: Using Linux native AIO
170912 7:53:06 InnoDB: Initializing buffer pool, size = 300.0M
InnoDB: mmap(321945600 bytes) failed; errno 12
170912 7:53:06 InnoDB: Completed initialization of buffer pool
170912 7:53:06 InnoDB: Fatal error: cannot allocate memory for the buffer pool
170912 7:53:06 [ERROR] Plugin 'InnoDB' init function returned error.
170912 7:53:06 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
170912 7:53:06 [ERROR] Unknown/unsupported storage engine: InnoDB
170912 7:53:06 [ERROR] Aborting
170912 7:53:06 [Note] /usr/sbin/mysqld: Shutdown complete
如果我增加缓冲池大小,服务器会更快停止运行。
答案 0 :(得分:0)
此错误: 170912 7:53:06 InnoDB:致命错误:无法为缓冲池分配内存
告诉您缓冲池大小不足以启动InnoDB。
修改/etc/MySQL/my.cnf
如果我不是那个目录,那么请find / -name my.cnf
搜索innodb_buffer_pool_size =
将目前的价值降低到不到50%的公羊。
innodb_buffer_pool_size = 20M
或者,您可以通过跳过innodb来启动MySQL。
sudo -u mysql mysqld --skip-innodb --default-storage-engine=myisam