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
Sparetire
V2EX  ›  MySQL

CentOS 7 安装 MySQL 无法启动,求指教

  •  
  •   Sparetire · 2016-05-09 23:06:16 +08:00 · 671 次点击
    这是一个创建于 3119 天前的主题,其中的信息可能已经有所发展或是发生改变。

    以前一直用 Debian 系,照着官方文档一路装过来都没啥问题,最近想换口味装了个 CentOS 7 ,结果一个 MySQL 就搞了一晚上没搞定。。

    大致过程,从官网下了个 Yum Repository

    # rpm -ivh mysql57-community-release-el7-8.noarch.rpm
    # yum update
    # yum install mysql-community-server
    

    一路顺利,然后启动

    # systemctl start mysqld
    Job for mysqld.service failed because the control process exited with error code. See "systemctl status mysqld.service" and "journalctl -xe" for details.
    

    报错,照着提示看了下发现并不能看懂。。对着一些信息搜索也无果,求教是什么原因

    # systemctl status mysqld.service
      mysqld.service - MySQL Server
       Loaded: loaded (/usr/lib/systemd/system/mysqld.service; enabled; vendor preset: disabled)
       Active: failed (Result: start-limit) since Tue 2016-05-10 08:03:40 CST; 1min 11s ago
      Process: 5126 ExecStart=/usr/sbin/mysqld --daemonize --pid-file=/var/run/mysqld/mysqld.pid $MYSQLD_OPTS (code=exited, status=1/FAILURE)
      Process: 5104 ExecStartPre=/usr/bin/mysqld_pre_systemd (code=exited, status=0/SUCCESS)
    
    May 10 08:03:40 FVCKGFW systemd[1]: Failed to start MySQL Server.
    May 10 08:03:40 FVCKGFW systemd[1]: Unit mysqld.service entered failed state.
    May 10 08:03:40 FVCKGFW systemd[1]: mysqld.service failed.
    May 10 08:03:40 FVCKGFW systemd[1]: mysqld.service holdoff time over, scheduling restart.
    May 10 08:03:40 FVCKGFW systemd[1]: start request repeated too quickly for mysqld.service
    May 10 08:03:40 FVCKGFW systemd[1]: Failed to start MySQL Server.
    May 10 08:03:40 FVCKGFW systemd[1]: Unit mysqld.service entered failed state.
    May 10 08:03:40 FVCKGFW systemd[1]: mysqld.service failed.
    
    # journalctl -xe
    -- Subject: Unit mysqld.service has begun start-up
    -- Defined-By: systemd
    -- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
    --
    -- Unit mysqld.service has begun starting up.
    May 10 08:03:40 FVCKGFW mysqld[5126]: Initialization of mysqld failed: 0
    May 10 08:03:40 FVCKGFW systemd[1]: mysqld.service: control process exited, code=exited status=1
    May 10 08:03:40 FVCKGFW systemd[1]: Failed to start MySQL Server.
    -- Subject: Unit mysqld.service has failed
    -- Defined-By: systemd
    -- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
    --
    -- Unit mysqld.service has failed.
    --
    -- The result is failed.
    May 10 08:03:40 FVCKGFW systemd[1]: Unit mysqld.service entered failed state.
    May 10 08:03:40 FVCKGFW systemd[1]: mysqld.service failed.
    May 10 08:03:40 FVCKGFW systemd[1]: mysqld.service holdoff time over, scheduling restart.
    May 10 08:03:40 FVCKGFW systemd[1]: start request repeated too quickly for mysqld.service
    May 10 08:03:40 FVCKGFW systemd[1]: Failed to start MySQL Server.
    -- Subject: Unit mysqld.service has failed
    -- Defined-By: systemd
    -- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
    --
    -- Unit mysqld.service has failed.
    --
    -- The result is failed.
    May 10 08:03:40 FVCKGFW systemd[1]: Unit mysqld.service entered failed state.
    May 10 08:03:40 FVCKGFW systemd[1]: mysqld.service failed.
    
    10 条回复    2016-08-11 12:00:28 +08:00
    doyel
        1
    doyel  
       2016-05-09 23:08:59 +08:00
    配置文件呢。。。还是没指定配置文件启动的?
    yangqi
        2
    yangqi  
       2016-05-09 23:11:58 +08:00
    看 mysql 自己的 error log
    raysonx
        3
    raysonx  
       2016-05-09 23:18:14 +08:00 via Android
    其实我想知道为什么楼主不用自带的 MariaDB ,非要用 rpm 安装 MySQL
    Sparetire
        4
    Sparetire  
    OP
       2016-05-09 23:23:11 +08:00
    刚刚发完贴就找到答案。。 https://stackoverflow.com/questions/34113689/job-for-mysqld-service-failed-centos-7 ,还是自己坑了,结贴,感谢各位
    Sparetire
        5
    Sparetire  
    OP
       2016-05-09 23:24:38 +08:00
    @raysonx 没用过 MariaDB ,怕不熟又得折腾半天。。

    @yangqi 看了日志,也找到原因了,感谢
    Neveroldmilk
        6
    Neveroldmilk  
       2016-05-10 10:45:49 +08:00
    没配置好 mysql 就启动了吧。
    xsseroot
        7
    xsseroot  
       2016-05-10 11:27:15 +08:00
    重启
    Cu635
        8
    Cu635  
       2016-05-10 15:05:11 +08:00
    @Sparetire
    mariadb 和 mysql 几乎完全兼容。
    hbprotoss
        9
    hbprotoss  
       2016-07-13 21:10:48 +08:00
    @Cu635 生产环境可差不得这个“几乎”
    Cu635
        10
    Cu635  
       2016-08-11 12:00:28 +08:00
    @hbprotoss

    你这么说,反而不够严谨。你的这句话所表达的含义和你说“生产环境差不得”所想的含义其实是矛盾的。

    如果你非得说的话,应该说“有的生产环境可差不得这个‘几乎’”。


    其实绝大部分生产环境是可以无缝兼容的,可以很轻松的从 mysql 迁移到 mariadb ,但是有的生产环境确实不行。这也是我上面回复当中“几乎”的来源。


    另外,@Livid , hbprotoss 在 28 天前就回复我了,但是未读提醒在我发这个帖子的时候才出来。这是个 bug 还是啥?
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   938 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 23ms · UTC 20:39 · PVG 04:39 · LAX 12:39 · JFK 15:39
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.