mysql运行过程中经常崩溃问题

前段时间在做wifi项目时,调试过程中数据库突然拒绝连接。。。

/etc/init.d/mysqld restart 重启mysql报错,,

尝试重启vagrant,才算解决,结果一段时间之后数据库又报错拒绝连接!!!

一天之内重启了四五次~~~

今天终于有时间打算找下问题:

show variables like ‘log_%’;(查看是否启用了日志)

mysql> show variables like ‘log_%’;

+----------------------------------------+---------------------------------------------+

| Variable_name                          | Value                       |

+----------------------------------------+---------------------------------------------+

| log_bin                                | ON                          |

| log_bin_basename                       | /data/mysql/3306/vagrant-centos65-bin       |

| log_bin_index                          | /data/mysql/3306/vagrant-centos65-bin.index |

| log_bin_trust_function_creators        | OFF                         |

| log_bin_use_v1_row_events              | OFF                         |

| log_error                              | /var/log/mysqld.log         |

| log_output                             | FILE                        |

| log_queries_not_using_indexes          | OFF                         |

| log_slave_updates                      | OFF                         |

| log_slow_admin_statements              | OFF                         |

| log_slow_slave_statements              | OFF                         |

| log_throttle_queries_not_using_indexes | 0                           |

| log_warnings                           | 1                           |

+----------------------------------------+---------------------------------------------+

13 rows in set (0.01 sec)

可以看到log_error日志文件路径:/var/log/mysqld.log

找到报错信息:

2018-11-23 02:50:28 4789 [ERROR] InnoDB: Cannot allocate memory for the buffer pool

2018-11-23 02:50:28 4789 [ERROR] Plugin 'InnoDB' init function returned error.

2018-11-23 02:50:28 4789 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.

2018-11-23 02:50:28 4789 [ERROR] Unknown/unsupported storage engine: InnoDB

2018-11-23 02:50:28 4789 [ERROR] Aborting

说无法分配内存缓冲池。。

free -m 查看内存使用情况,还有200多M,将服务器上不用的tomcat给kill掉;

将my.conf中 innodb_buffer_pool_size 的值改为了128

重启成功~

你可能感兴趣的:(Mysql)