V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX 提问指南
linfox
V2EX  ›  问与答

VPS 经常出现无法连接到数据库的错误,重启之后又好了?

  •  
  •   linfox · 2014-11-09 01:57:31 +08:00 · 3801 次点击
    这是一个创建于 3673 天前的主题,其中的信息可能已经有所发展或是发生改变。
    以下是数据库日志,请帮忙分析下:
    -------------------------------------------------


    Number of processes running now: 0
    141104 23:25:13 mysqld restarted
    InnoDB: The log sequence number in ibdata files does not match
    InnoDB: the log sequence number in the ib_logfiles!
    141104 23:25:13 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...
    141104 23:25:14 InnoDB: Started; log sequence number 0 398119697
    141104 23:25:14 [Note] /usr/libexec/mysqld: ready for connections.
    Version: '5.0.96' socket: '/var/lib/mysql/mysql.sock' port: 3306 Source distribution

    Number of processes running now: 0
    141105 01:14:29 mysqld restarted
    InnoDB: The log sequence number in ibdata files does not match
    InnoDB: the log sequence number in the ib_logfiles!
    141105 1:14:30 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...
    141105 1:14:33 InnoDB: Started; log sequence number 0 398224842
    141105 1:14:33 [Note] /usr/libexec/mysqld: ready for connections.
    Version: '5.0.96' socket: '/var/lib/mysql/mysql.sock' port: 3306 Source distribution

    Number of processes running now: 0
    141105 01:16:55 mysqld restarted
    InnoDB: The log sequence number in ibdata files does not match
    InnoDB: the log sequence number in the ib_logfiles!
    141105 1:16:55 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...
    141105 1:16:56 InnoDB: Started; log sequence number 0 398224842
    141105 1:16:56 [Note] /usr/libexec/mysqld: ready for connections.
    Version: '5.0.96' socket: '/var/lib/mysql/mysql.sock' port: 3306 Source distribution

    Number of processes running now: 0
    141105 01:17:26 mysqld restarted
    InnoDB: The log sequence number in ibdata files does not match
    InnoDB: the log sequence number in the ib_logfiles!
    141105 1:17:26 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...
    141105 1:17:27 InnoDB: Started; log sequence number 0 398224842
    141105 1:17:27 [Note] /usr/libexec/mysqld: ready for connections.
    Version: '5.0.96' socket: '/var/lib/mysql/mysql.sock' port: 3306 Source distribution

    Number of processes running now: 0
    141105 11:14:12 mysqld restarted
    InnoDB: The log sequence number in ibdata files does not match
    InnoDB: the log sequence number in the ib_logfiles!
    141105 11:14:22 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...
    141105 11:14:23 InnoDB: Started; log sequence number 0 398473823
    141105 11:14:23 [Note] /usr/libexec/mysqld: ready for connections.
    Version: '5.0.96' socket: '/var/lib/mysql/mysql.sock' port: 3306 Source distribution

    Number of processes running now: 0
    141105 19:13:17 mysqld restarted
    InnoDB: The log sequence number in ibdata files does not match
    InnoDB: the log sequence number in the ib_logfiles!
    141105 19:13:18 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...
    141105 19:13:19 InnoDB: Started; log sequence number 0 398473823
    141105 19:13:20 [Note] /usr/libexec/mysqld: ready for connections.
    Version: '5.0.96' socket: '/var/lib/mysql/mysql.sock' port: 3306 Source distribution

    Number of processes running now: 0
    141105 23:47:39 mysqld restarted
    InnoDB: The log sequence number in ibdata files does not match
    InnoDB: the log sequence number in the ib_logfiles!
    141105 23:48:00 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...
    141105 23:48:00 InnoDB: Started; log sequence number 0 398598629
    141105 23:48:00 [Note] /usr/libexec/mysqld: ready for connections.
    Version: '5.0.96' socket: '/var/lib/mysql/mysql.sock' port: 3306 Source distribution

    Number of processes running now: 0
    141105 23:48:35 mysqld restarted
    InnoDB: The log sequence number in ibdata files does not match
    InnoDB: the log sequence number in the ib_logfiles!
    141105 23:48:35 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...
    141105 23:48:36 InnoDB: Started; log sequence number 0 398598629
    141105 23:48:36 [Note] /usr/libexec/mysqld: ready for connections.
    Version: '5.0.96' socket: '/var/lib/mysql/mysql.sock' port: 3306 Source distribution

    Number of processes running now: 0
    141105 23:49:23 mysqld restarted
    InnoDB: The log sequence number in ibdata files does not match
    InnoDB: the log sequence number in the ib_logfiles!
    141105 23:49:24 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...
    141105 23:49:24 InnoDB: Started; log sequence number 0 398598629
    141105 23:49:24 [Note] /usr/libexec/mysqld: ready for connections.
    Version: '5.0.96' socket: '/var/lib/mysql/mysql.sock' port: 3306 Source distribution

    Number of processes running now: 0
    141105 23:50:18 mysqld restarted
    InnoDB: The log sequence number in ibdata files does not match
    InnoDB: the log sequence number in the ib_logfiles!
    141105 23:50:19 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...
    141105 23:50:21 InnoDB: Started; log sequence number 0 398598629
    141105 23:50:22 [Note] /usr/libexec/mysqld: ready for connections.
    Version: '5.0.96' socket: '/var/lib/mysql/mysql.sock' port: 3306 Source distribution

    Number of processes running now: 0
    141105 23:51:10 mysqld restarted
    InnoDB: The log sequence number in ibdata files does not match
    InnoDB: the log sequence number in the ib_logfiles!
    141105 23:51:10 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...
    141105 23:51:11 InnoDB: Started; log sequence number 0 398598629
    141105 23:51:11 [Note] /usr/libexec/mysqld: ready for connections.
    Version: '5.0.96' socket: '/var/lib/mysql/mysql.sock' port: 3306 Source distribution

    Number of processes running now: 0
    141105 23:51:31 mysqld restarted
    InnoDB: The log sequence number in ibdata files does not match
    InnoDB: the log sequence number in the ib_logfiles!
    141105 23:51:32 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...
    141105 23:51:33 InnoDB: Started; log sequence number 0 398598629
    141105 23:51:33 [Note] /usr/libexec/mysqld: ready for connections.
    Version: '5.0.96' socket: '/var/lib/mysql/mysql.sock' port: 3306 Source distribution

    Number of processes running now: 0
    141105 23:52:00 mysqld restarted
    InnoDB: The log sequence number in ibdata files does not match
    InnoDB: the log sequence number in the ib_logfiles!
    141105 23:52:00 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...
    141105 23:52:01 InnoDB: Started; log sequence number 0 398598629
    141105 23:52:01 [Note] /usr/libexec/mysqld: ready for connections.
    Version: '5.0.96' socket: '/var/lib/mysql/mysql.sock' port: 3306 Source distribution

    Number of processes running now: 0
    141105 23:52:48 mysqld restarted
    InnoDB: The log sequence number in ibdata files does not match
    InnoDB: the log sequence number in the ib_logfiles!
    141105 23:52:48 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...
    141105 23:52:50 InnoDB: Started; log sequence number 0 398598629
    141105 23:52:53 [Note] /usr/libexec/mysqld: ready for connections.
    Version: '5.0.96' socket: '/var/lib/mysql/mysql.sock' port: 3306 Source distribution

    Number of processes running now: 0
    141105 23:54:35 mysqld restarted
    InnoDB: The log sequence number in ibdata files does not match
    InnoDB: the log sequence number in the ib_logfiles!
    141105 23:54:40 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...
    141105 23:54:41 InnoDB: Started; log sequence number 0 398598629
    141105 23:54:41 [Note] /usr/libexec/mysqld: ready for connections.
    Version: '5.0.96' socket: '/var/lib/mysql/mysql.sock' port: 3306 Source distribution

    Number of processes running now: 0
    141105 23:56:56 mysqld restarted
    InnoDB: The log sequence number in ibdata files does not match
    InnoDB: the log sequence number in the ib_logfiles!
    141105 23:56:57 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...
    141105 23:57:12 InnoDB: Started; log sequence number 0 398598629
    141105 23:57:13 [Note] /usr/libexec/mysqld: ready for connections.
    Version: '5.0.96' socket: '/var/lib/mysql/mysql.sock' port: 3306 Source distribution

    Number of processes running now: 0
    141105 23:57:51 mysqld restarted
    InnoDB: The log sequence number in ibdata files does not match
    InnoDB: the log sequence number in the ib_logfiles!
    141105 23:57:51 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...
    141105 23:57:52 InnoDB: Started; log sequence number 0 398598629
    141105 23:57:52 [Note] /usr/libexec/mysqld: ready for connections.
    Version: '5.0.96' socket: '/var/lib/mysql/mysql.sock' port: 3306 Source distribution

    Number of processes running now: 0
    141105 23:59:06 mysqld restarted
    InnoDB: The log sequence number in ibdata files does not match
    InnoDB: the log sequence number in the ib_logfiles!
    141105 23:59:06 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...
    141105 23:59:07 InnoDB: Started; log sequence number 0 398598629
    141105 23:59:07 [Note] /usr/libexec/mysqld: ready for connections.
    Version: '5.0.96' socket: '/var/lib/mysql/mysql.sock' port: 3306 Source distribution

    Number of processes running now: 0
    141105 23:59:56 mysqld restarted
    InnoDB: The log sequence number in ibdata files does not match
    InnoDB: the log sequence number in the ib_logfiles!
    141105 23:59: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...
    141105 23:59:57 InnoDB: Started; log sequence number 0 398598629
    141105 23:59:57 [Note] /usr/libexec/mysqld: ready for connections.
    Version: '5.0.96' socket: '/var/lib/mysql/mysql.sock' port: 3306 Source distribution

    Number of processes running now: 0
    141106 00:00:46 mysqld restarted
    InnoDB: Log scan progressed past the checkpoint lsn 0 398598629
    141106 0:00:48 InnoDB: Database was not shut down normally!
    InnoDB: Starting crash recovery.
    InnoDB: Reading tablespace information from the .ibd files...
    141106 00:01:14 mysqld ended

    141107 06:41:30 mysqld started
    InnoDB: Log scan progressed past the checkpoint lsn 0 398598629
    141107 6:41:30 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 0 398598639
    141107 6:41:31 InnoDB: Started; log sequence number 0 398598639
    141107 6:41:31 [Note] /usr/libexec/mysqld: ready for connections.
    Version: '5.0.96' socket: '/var/lib/mysql/mysql.sock' port: 3306 Source distribution

    Number of processes running now: 0
    141107 12:24:01 mysqld restarted
    InnoDB: Log scan progressed past the checkpoint lsn 0 398834656
    141107 12:24:02 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 0 398939488
    141107 12:24:03 InnoDB: Starting an apply batch of log records to the database...
    InnoDB: Progress in percents: 0 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 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
    141107 12:24:05 InnoDB: Started; log sequence number 0 398939488
    141107 12:24:06 [Note] /usr/libexec/mysqld: ready for connections.
    Version: '5.0.96' socket: '/var/lib/mysql/mysql.sock' port: 3306 Source distribution

    Number of processes running now: 0
    141107 12:27:50 mysqld restarted
    InnoDB: The log sequence number in ibdata files does not match
    InnoDB: the log sequence number in the ib_logfiles!
    141107 12:27:50 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...
    141107 12:27:51 InnoDB: Started; log sequence number 0 398939575
    141107 12:27:51 [Note] /usr/libexec/mysqld: ready for connections.
    Version: '5.0.96' socket: '/var/lib/mysql/mysql.sock' port: 3306 Source distribution

    Number of processes running now: 0
    141107 12:30:45 mysqld restarted
    InnoDB: The log sequence number in ibdata files does not match
    InnoDB: the log sequence number in the ib_logfiles!
    141107 12:30:48 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...
    141107 12:30:49 InnoDB: Started; log sequence number 0 398939575
    141107 12:30:49 [Note] /usr/libexec/mysqld: ready for connections.
    Version: '5.0.96' socket: '/var/lib/mysql/mysql.sock' port: 3306 Source distribution

    Number of processes running now: 0
    141107 12:33:01 mysqld restarted
    InnoDB: The log sequence number in ibdata files does not match
    InnoDB: the log sequence number in the ib_logfiles!
    141107 12:33:01 InnoDB: Database was not shut down normally!
    InnoDB: Starting crash recovery.
    InnoDB: Reading tablespace information from the .ibd files...
    141107 12:33:32 mysqld ended

    141108 17:49:49 mysqld started
    InnoDB: The log sequence number in ibdata files does not match
    InnoDB: the log sequence number in the ib_logfiles!
    141108 17:49:49 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...
    141108 17:49:49 InnoDB: Started; log sequence number 0 398939575
    141108 17:49:49 [Note] /usr/libexec/mysqld: ready for connections.
    Version: '5.0.96' socket: '/var/lib/mysql/mysql.sock' port: 3306 Source distribution
    5 条回复    2014-11-19 17:05:09 +08:00
    a2z
        1
    a2z  
       2014-11-09 07:00:37 +08:00
    mysql内存不足
    lazycat
        2
    lazycat  
       2014-11-09 09:07:23 +08:00 via Android
    喜闻乐见的问题。。。目测Apache占用太多内存然后Mysql被kill了
    hjc4869
        3
    hjc4869  
       2014-11-09 11:46:44 +08:00
    mysql被系统kill了。换大RAM的VPS,或者,最简单的方法是把mysql进程的oom_score调成0即可……
    楼主的情况很有可能是被DDoS了。
    manan
        4
    manan  
       2014-11-09 12:51:02 +08:00
    增加系统swap空间可以缓解
    ddnet02
        5
    ddnet02  
       2014-11-19 17:05:09 +08:00
    @hjc4869 请问怎么"把mysql进程的oom_score调成0",新手不懂
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   2879 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 28ms · UTC 13:28 · PVG 21:28 · LAX 05:28 · JFK 08:28
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.