mysql数据库经常连接不上,重启数据库后就可以正常使用!!

mhand 2017-07-27 10:37:24
数据库工作正常然后工作几天之后就会无故连接不上,重启数据库后就可以正常使用!!



mysql日志


170720 10:25:08 [Note] Event Scheduler: Purging the queue. 0 events
170720 10:25:08 InnoDB: Starting shutdown...
170720 10:25:08 InnoDB: Shutdown completed; log sequence number 1789395
170720 10:25:08 [Note] /usr/local/mysql/bin/mysqld: Shutdown complete

170720 10:25:09 [Note] Plugin 'FEDERATED' is disabled.
170720 10:25:09 InnoDB: The InnoDB memory heap is disabled
170720 10:25:09 InnoDB: Mutexes and rw_locks use GCC atomic builtins
170720 10:25:09 InnoDB: Compressed tables use zlib 1.2.7
170720 10:25:09 InnoDB: Initializing buffer pool, size = 64.0M
170720 10:25:09 InnoDB: Completed initialization of buffer pool
170720 10:25:09 InnoDB: highest supported file format is Barracuda.
170720 10:25:09 InnoDB: Waiting for the background threads to start
170720 10:25:10 InnoDB: 5.5.56 started; log sequence number 1789395
170720 10:25:10 [Note] Server hostname (bind-address): '0.0.0.0'; port: 3306
170720 10:25:10 [Note] - '0.0.0.0' resolves to '0.0.0.0';
170720 10:25:10 [Note] Server socket created on IP: '0.0.0.0'.
170720 10:25:10 [Note] Event Scheduler: Loaded 0 events
170720 10:25:10 [Note] /usr/local/mysql/bin/mysqld: ready for connections.
Version: '5.5.56-log' socket: '/tmp/mysql.sock' port: 3306 Source distribution
170722 15:30:47 [Note] Plugin 'FEDERATED' is disabled.
170722 15:30:47 InnoDB: The InnoDB memory heap is disabled
170722 15:30:47 InnoDB: Mutexes and rw_locks use GCC atomic builtins
170722 15:30:47 InnoDB: Compressed tables use zlib 1.2.7
170722 15:30:47 InnoDB: Initializing buffer pool, size = 64.0M
InnoDB: mmap(68681728 bytes) failed; errno 12
170722 15:30:47 InnoDB: Completed initialization of buffer pool
170722 15:30:47 InnoDB: Fatal error: cannot allocate memory for the buffer pool
170722 15:30:47 [ERROR] Plugin 'InnoDB' init function returned error.
170722 15:30:47 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
170722 15:30:47 [ERROR] Unknown/unsupported storage engine: InnoDB
170722 15:30:47 [ERROR] Aborting

170722 15:30:47 [Note] /usr/local/mysql/bin/mysqld: Shutdown complete

170722 23:07:32 [Note] Plugin 'FEDERATED' is disabled.
170722 23:07:32 InnoDB: The InnoDB memory heap is disabled
170722 23:07:32 InnoDB: Mutexes and rw_locks use GCC atomic builtins
170722 23:07:32 InnoDB: Compressed tables use zlib 1.2.7
170722 23:07:32 InnoDB: Initializing buffer pool, size = 64.0M
170722 23:07:32 InnoDB: Completed initialization of buffer pool
170722 23:07:32 InnoDB: highest supported file format is Barracuda.
170722 23:07:32 InnoDB: Waiting for the background threads to start
170722 23:07:33 InnoDB: 5.5.56 started; log sequence number 1789395
170722 23:07:33 [Note] Recovering after a crash using mysql-bin
170722 23:07:33 [Note] Starting crash recovery...
170722 23:07:33 [Note] Crash recovery finished.
170722 23:07:33 [Note] Server hostname (bind-address): '0.0.0.0'; port: 3306
170722 23:07:33 [Note] - '0.0.0.0' resolves to '0.0.0.0';
170722 23:07:33 [Note] Server socket created on IP: '0.0.0.0'.
170722 23:07:33 [Note] Event Scheduler: Loaded 0 events
170722 23:07:33 [Note] /usr/local/mysql/bin/mysqld: ready for connections.
Version: '5.5.56-log' socket: '/tmp/mysql.sock' port: 3306 Source distribution
170725 17:53:00 [Note] Plugin 'FEDERATED' is disabled.
170725 17:53:00 InnoDB: The InnoDB memory heap is disabled
170725 17:53:00 InnoDB: Mutexes and rw_locks use GCC atomic builtins
170725 17:53:00 InnoDB: Compressed tables use zlib 1.2.7
170725 17:53:00 InnoDB: Initializing buffer pool, size = 64.0M
170725 17:53:00 InnoDB: Completed initialization of buffer pool
170725 17:53:00 InnoDB: highest supported file format is Barracuda.
170725 17:53:01 InnoDB: Waiting for the background threads to start
170725 17:53:02 InnoDB: 5.5.56 started; log sequence number 1789395
170725 17:53:02 [Note] Recovering after a crash using mysql-bin
170725 17:53:02 [Note] Starting crash recovery...
170725 17:53:02 [Note] Crash recovery finished.
170725 17:53:02 [Note] Server hostname (bind-address): '0.0.0.0'; port: 3306
170725 17:53:02 [Note] - '0.0.0.0' resolves to '0.0.0.0';
170725 17:53:02 [Note] Server socket created on IP: '0.0.0.0'.
170725 17:53:02 [Note] Event Scheduler: Loaded 0 events
170725 17:53:02 [Note] /usr/local/mysql/bin/mysqld: ready for connections.
Version: '5.5.56-log' socket: '/tmp/mysql.sock' port: 3306 Source distribution
170725 17:53:05 [Note] Plugin 'FEDERATED' is disabled.
170725 17:53:05 InnoDB: The InnoDB memory heap is disabled
170725 17:53:05 InnoDB: Mutexes and rw_locks use GCC atomic builtins
170725 17:53:05 InnoDB: Compressed tables use zlib 1.2.7
170725 17:53:05 InnoDB: Initializing buffer pool, size = 64.0M
InnoDB: mmap(68681728 bytes) failed; errno 12
170725 17:53:05 InnoDB: Completed initialization of buffer pool
170725 17:53:05 InnoDB: Fatal error: cannot allocate memory for the buffer pool
170725 17:53:05 [ERROR] Plugin 'InnoDB' init function returned error.
170725 17:53:05 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
170725 17:53:05 [ERROR] Unknown/unsupported storage engine: InnoDB
170725 17:53:05 [ERROR] Aborting

170725 17:53:05 [Note] /usr/local/mysql/bin/mysqld: Shutdown complete

170725 18:37:57 [Note] Plugin 'FEDERATED' is disabled.
170725 18:37:57 InnoDB: The InnoDB memory heap is disabled
170725 18:37:57 InnoDB: Mutexes and rw_locks use GCC atomic builtins
170725 18:37:57 InnoDB: Compressed tables use zlib 1.2.7
170725 18:37:57 InnoDB: Initializing buffer pool, size = 64.0M
170725 18:37:57 InnoDB: Completed initialization of buffer pool
170725 18:37:57 InnoDB: highest supported file format is Barracuda.
170725 18:37:57 InnoDB: Waiting for the background threads to start
170725 18:37:58 InnoDB: 5.5.56 started; log sequence number 1789395
170725 18:37:58 [Note] Recovering after a crash using mysql-bin
170725 18:37:58 [Note] Starting crash recovery...
170725 18:37:58 [Note] Crash recovery finished.
170725 18:37:58 [Note] Server hostname (bind-address): '0.0.0.0'; port: 3306
170725 18:37:58 [Note] - '0.0.0.0' resolves to '0.0.0.0';
170725 18:37:58 [Note] Server socket created on IP: '0.0.0.0'.
170725 18:37:58 [Note] Event Scheduler: Loaded 0 events
170725 18:37:58 [Note] /usr/local/mysql/bin/mysqld: ready for connections.
Version: '5.5.56-log' socket: '/tmp/mysql.sock' port: 3306 Source distribution
170726 19:54:39 [Note] Plugin 'FEDERATED' is disabled.
170726 19:54:39 InnoDB: The InnoDB memory heap is disabled
170726 19:54:39 InnoDB: Mutexes and rw_locks use GCC atomic builtins
170726 19:54:39 InnoDB: Compressed tables use zlib 1.2.7
170726 19:54:39 InnoDB: Initializing buffer pool, size = 64.0M
InnoDB: mmap(68681728 bytes) failed; errno 12
170726 19:54:39 InnoDB: Completed initialization of buffer pool
170726 19:54:39 InnoDB: Fatal error: cannot allocate memory for the buffer pool
170726 19:54:39 [ERROR] Plugin 'InnoDB' init function returned error.
170726 19:54:39 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
170726 19:54:39 [ERROR] Unknown/unsupported storage engine: InnoDB
170726 19:54:39 [ERROR] Aborting

170726 19:54:39 [Note] /usr/local/mysql/bin/mysqld: Shutdown complete

170727 8:39:52 [Note] Plugin 'FEDERATED' is disabled.
170727 8:39:52 InnoDB: The InnoDB memory heap is disabled
170727 8:39:52 InnoDB: Mutexes and rw_locks use GCC atomic builtins
170727 8:39:52 InnoDB: Compressed tables use zlib 1.2.7
170727 8:39:52 InnoDB: Initializing buffer pool, size = 64.0M
170727 8:39:52 InnoDB: Completed initialization of buffer pool
170727 8:39:52 InnoDB: highest supported file format is Barracuda.
170727 8:39:52 InnoDB: Waiting for the background threads to start
170727 8:39:53 InnoDB: 5.5.56 started; log sequence number 1789395
170727 8:39:53 [Note] Recovering after a crash using mysql-bin
170727 8:39:53 [Note] Starting crash recovery...
170727 8:39:53 [Note] Crash recovery finished.
170727 8:39:53 [Note] Server hostname (bind-address): '0.0.0.0'; port: 3306
170727 8:39:53 [Note] - '0.0.0.0' resolves to '0.0.0.0';
170727 8:39:53 [Note] Server socket created on IP: '0.0.0.0'.
170727 8:39:53 [Note] Event Scheduler: Loaded 0 events
170727 8:39:53 [Note] /usr/local/mysql/bin/mysqld: ready for connections.
Version: '5.5.56-log' socket: '/tmp/mysql.sock' port: 3306 Source distribution
...全文
1388 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
ckc 2017-07-28
  • 打赏
  • 举报
回复
Fatal error: cannot allocate memory for the buffer pool 不知道是不是设置的缓冲区太大所以出错了 检查下配置吧
qq_39651978 2017-07-28
  • 打赏
  • 举报
回复
不一定是连接不上,可能是有延迟,所以导致提示无法连接
凡迪 2017-07-28
  • 打赏
  • 举报
回复 1
内存分配不足所以失败。 日志里面说的很明白就是 mysql要占用内存的时候 物理内存不够用导致的,所以修改 vim /etc/my.cnf [inonodb] innodb_buffer_pool_size=64MB 把这个数值改小,或者增大你的服务器内存。 如果正常运行几天后发现数据库连接不上,你可以监控一下你机器的内存使用情况,看看有没有内存泄漏,或者确实机器内存太小,随着应用的增多而不够使用。
  • 打赏
  • 举报
回复
从日志里并灭有看到什么相关的mysql的报错信息,除了innodb引擎那个

56,677

社区成员

发帖
与我相关
我的任务
社区描述
MySQL相关内容讨论专区
社区管理员
  • MySQL
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧