V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
MySQL 5.5 Community Server
MySQL 5.6 Community Server
Percona Configuration Wizard
XtraBackup 搭建主从复制
Great Sites on MySQL
Percona
MySQL Performance Blog
Severalnines
推荐管理工具
Sequel Pro
phpMyAdmin
推荐书目
MySQL Cookbook
MySQL 相关项目
MariaDB
Drizzle
参考文档
http://mysql-python.sourceforge.net/MySQLdb.html
zhjits
V2EX  ›  MySQL

MySQL( Percona)莫名挂了,求助

  •  
  •   zhjits ·
    Jamesits · 2015-08-04 20:43:38 +08:00 · 7426 次点击
    这是一个创建于 3405 天前的主题,其中的信息可能已经有所发展或是发生改变。

    mysql Ver 14.14 Distrib 5.6.25-73.1, for debian-linux-gnu (x86_64) using 6.3

    Aug 04 08:42:25 hostname /etc/init.d/mysql[2078]: 0 processes alive and '/usr/bin/mysqladmin --defaults-file=/etc/mysql/debian.cnf ping' resulted in
    Aug 04 08:42:25 hostname /etc/init.d/mysql[2078]: [61B blob data]
    Aug 04 08:42:25 hostname /etc/init.d/mysql[2078]: error: 'Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)'
    Aug 04 08:42:25 hostname /etc/init.d/mysql[2078]: Check that mysqld is running and that the socket: '/var/run/mysqld/mysqld.sock' exists!
    Aug 04 08:42:25 hostname /etc/init.d/mysql[2078]:
    Aug 04 08:42:25 hostname systemd[1]: mysql.service: control process exited, code=exited status=1
    Aug 04 08:42:25 hostname systemd[1]: Failed to start LSB: Start and stop the mysql (Percona Server) daemon.
    -- Subject: Unit mysql.service has failed
    -- Unit mysql.service has failed.
    Aug 04 08:42:25 hostname systemd[1]: Unit mysql.service entered failed state.
    Aug 04 08:42:25 hostname systemd[1]: mysql.service failed.
    Aug 04 08:42:25 hostname mysql[1856]: ...fail!

    第 1 条附言  ·  2015-08-04 21:27:22 +08:00
    已解决,参考了 https://www.digitalocean.com/community/questions/mysql-server-keeps-stopping-unexpectedly 的方法。

    /etc/mysql/my.cnf:

    # Generated by Percona Configuration Wizard (http://tools.percona.com/) version REL5-20120208

    [mysql]

    # CLIENT #
    port = 3306
    socket = /var/run/mysqld/mysqld.sock

    [mysqld]

    # GENERAL #
    user = mysql
    default-storage-engine = InnoDB
    socket = /var/run/mysqld/mysqld.sock
    pid-file = /var/run/mysqld/mysqld.pid
    performance_schema = off

    # MyISAM #
    key-buffer-size = 32M
    myisam-recover = FORCE,BACKUP

    # SAFETY #
    max-allowed-packet = 16M
    max-connect-errors = 1000000

    # DATA STORAGE #
    datadir = /var/lib/mysql/

    # BINARY LOGGING #
    log-bin = /var/lib/mysql/mysql-bin
    expire-logs-days = 14
    sync-binlog = 1

    # CACHES AND LIMITS #
    tmp-table-size = 32M
    max-heap-table-size = 32M
    query-cache-type = 0
    query-cache-size = 0
    max-connections = 500
    thread-cache-size = 50
    open-files-limit = 65535
    table-definition-cache = 1024
    table-open-cache = 2048

    # INNODB #
    innodb-flush-method = O_DIRECT
    innodb-log-files-in-group = 2
    innodb-log-file-size = 64M
    innodb-flush-log-at-trx-commit = 1
    innodb-file-per-table = 1
    innodb-buffer-pool-size = 128M

    # LOGGING #
    log-error = /var/lib/mysql/mysql-error.log
    log-queries-not-using-indexes = 1
    slow-query-log = 1
    slow-query-log-file = /var/lib/mysql/mysql-slow.log
    5 条回复    2015-08-05 11:53:37 +08:00
    zhjits
        1
    zhjits  
    OP
       2015-08-04 21:16:55 +08:00
    150804 09:05:12 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
    2015-08-04 09:05:12 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
    2015-08-04 09:05:12 0 [Note] /usr/sbin/mysqld (mysqld 5.6.25-73.1) starting as process 2836 ...
    2015-08-04 09:05:13 2836 [ERROR] Failed to initialize timer component (errno 12).
    2015-08-04 09:05:13 2836 [Note] Plugin 'FEDERATED' is disabled.
    2015-08-04 09:05:13 2836 [Warning] The option innodb (skip-innodb) is deprecated and will be removed in a future release
    2015-08-04 09:05:13 2836 [Note] Plugin 'InnoDB' is disabled.
    2015-08-04 09:05:13 2836 [ERROR] Function 'innodb' already exists
    2015-08-04 09:05:13 2836 [Warning] Couldn't load plugin named 'innodb' with soname 'ha_innodb.so'.
    2015-08-04 09:05:13 2836 [ERROR] Function 'federated' already exists
    2015-08-04 09:05:13 2836 [Warning] Couldn't load plugin named 'federated' with soname 'ha_federated.so'.
    2015-08-04 09:05:13 2836 [ERROR] Function 'blackhole' already exists
    2015-08-04 09:05:13 2836 [Warning] Couldn't load plugin named 'blackhole' with soname 'ha_blackhole.so'.
    2015-08-04 09:05:13 2836 [ERROR] Function 'archive' already exists
    2015-08-04 09:05:13 2836 [Warning] Couldn't load plugin named 'archive' with soname 'ha_archive.so'.
    2015-08-04 09:05:13 2836 [ERROR] Unknown/unsupported storage engine: InnoDB
    2015-08-04 09:05:13 2836 [ERROR] Aborting
    ipconfiger
        2
    ipconfiger  
       2015-08-04 21:28:10 +08:00
    断过电?
    zhjits
        3
    zhjits  
    OP
       2015-08-04 21:31:17 +08:00
    @ipconfiger 没有,不过是 apt-get upgrade 之后出现的
    henryon
        4
    henryon  
       2015-08-05 10:04:43 +08:00
    ...自己解决了就好。
    pubby
        5
    pubby  
       2015-08-05 11:53:37 +08:00
    之前遇到过跨大版本升级导致启动失败
    从5.1.x 升级到 5.6.x

    后来 先降到5.5.x 用自带mysql_upgrade 升级数据
    再升级到 5.6.x ,mysql_upgrade升级数据后才正常
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   2765 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 22ms · UTC 09:30 · PVG 17:30 · LAX 01:30 · JFK 04:30
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.