【问题标题】:MySQL Server shuts down frequently and won't start again nowMySQL 服务器经常关闭,现在不会重新启动
【发布时间】:2017-06-26 01:10:43
【问题描述】:

操作系统: Ubuntu 16.04.1 LTS xenial

我在 AWS 上的服务器上安装了 MySQL,它运行良好,但在我们开始在现场获得大量流量后,它开始经常出现故障。为了修复它,我通常重新启动服务或服务器,但它只工作了几分钟/几小时,然后它又失败了。现在即使我重新启动服务器,MySQL 也不会再次启动。

运行sudo systemctl start mysql 我收到这条消息

mysql.service 的作业失败,因为控制进程以错误代码退出。详见“systemctl status mysql.service”和“journalctl -xe”。

这是/var/log/mysql/error.log登录的内容

2017-02-08T11:35:32.352942Z 0 [Warning] Changed limits: max_open_files: 1024 (requested 5000)
2017-02-08T11:35:32.352975Z 0 [Warning] Changed limits: table_open_cache: 431 (requested 2000)
2017-02-08T11:35:32.509812Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2017-02-08T11:35:32.510752Z 0 [Note] /usr/sbin/mysqld (mysqld 5.7.17-0ubuntu0.16.04.1) starting as process 3060 ...
2017-02-08T11:35:32.514030Z 0 [Note] InnoDB: PUNCH HOLE support available
2017-02-08T11:35:32.514046Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2017-02-08T11:35:32.514049Z 0 [Note] InnoDB: Uses event mutexes
2017-02-08T11:35:32.514054Z 0 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
2017-02-08T11:35:32.514057Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.8
2017-02-08T11:35:32.514060Z 0 [Note] InnoDB: Using Linux native AIO
2017-02-08T11:35:32.514265Z 0 [Note] InnoDB: Number of pools: 1
2017-02-08T11:35:32.514359Z 0 [Note] InnoDB: Using CPU crc32 instructions
2017-02-08T11:35:32.515647Z 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M
2017-02-08T11:35:32.522465Z 0 [Note] InnoDB: Completed initialization of buffer pool
2017-02-08T11:35:32.524160Z 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
2017-02-08T11:35:32.535815Z 0 [Note] InnoDB: Highest supported file format is Barracuda.
2017-02-08T11:35:32.536689Z 0 [Note] InnoDB: Log scan progressed past the checkpoint lsn 30903245
2017-02-08T11:35:32.536703Z 0 [Note] InnoDB: Doing recovery: scanned up to log sequence number 30904484
2017-02-08T11:35:32.536738Z 0 [ERROR] InnoDB: Ignoring the redo log due to missing MLOG_CHECKPOINT between the checkpoint 30903245 and the end 30904484.
2017-02-08T11:35:32.536747Z 0 [ERROR] InnoDB: Plugin initialization aborted with error Generic error
2017-02-08T11:35:33.137801Z 0 [ERROR] Plugin 'InnoDB' init function returned error.
2017-02-08T11:35:33.137835Z 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
2017-02-08T11:35:33.137841Z 0 [ERROR] Failed to initialize plugins.
2017-02-08T11:35:33.137843Z 0 [ERROR] Aborting

2017-02-08T11:35:33.137848Z 0 [Note] Binlog end
2017-02-08T11:35:33.137893Z 0 [Note] Shutting down plugin 'MyISAM'
2017-02-08T11:35:33.137914Z 0 [Note] Shutting down plugin 'CSV'
2017-02-08T11:35:33.138111Z 0 [Note] /usr/sbin/mysqld: Shutdown complete

【问题讨论】:

    标签: mysql amazon-web-services ubuntu amazon-ec2


    【解决方案1】:

    仍然不知道出了什么问题,但删除文件/var/lib/mysql/ib_logfile* 解决了。

    【讨论】:

    • 我在 Docker Compuse 中遇到了这个问题,为了访问文件,我运行了:docker-compose run --rm db /bin/bash(其中db 是您的数据库服务),然后从那里删除文件。
    • 我整天都在烦恼。你救了我。此答案适用于 /var/log/mysql/error.log 中的错误:[ERROR] InnoDB: Ignoring the redo log due to missing MLOG_CHECKPOINT between the checkpoint 30903245 and end 30904484.
    • 它解决了我的问题,但很高兴知道出了什么问题
    【解决方案2】:

    请尝试以下方法

    /etc/init.d/mysql stop
    service mysql stop
    sudo killall -KILL mysql mysqld_safe mysqld
    /etc/init.d/mysql start
    systemctl status mysql
    

    它应该显示 mysql 服务器的活动状态

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-07-11
      • 1970-01-01
      • 1970-01-01
      • 2012-11-08
      • 2015-08-19
      相关资源
      最近更新 更多