V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
kmdd33
V2EX  ›  程序员

mysql 启动失败

  •  
  •   kmdd33 · 2018-06-13 23:56:11 +08:00 · 4172 次点击
    这是一个创建于 2347 天前的主题,其中的信息可能已经有所发展或是发生改变。

    yum 安装好 mysql 后出现无法新建数据库,只要进入数据,按照下面的教程: https://linode.com/docs/databases/mysql/how-to-install-mysql-on-centos-7/ 新建数据库 会出现:Access denied for user 'xxx'@'%' to database 'xxxx'

    于是 google 了几个教程: https://blog.csdn.net/chun8416/article/details/50177117

    但是修改后:现在无法启动 mysql 了,请问如何解决?

    systemctl status mysqld.service -l

    ● mysqld.service - MySQL Community Server

    Loaded: loaded (/usr/lib/systemd/system/mysqld.service; enabled; vendor preset: disabled)

    Active: failed (Result: start-limit) since Wed 2018-06-13 15:47:14 UTC; 23s ago

    Process: 4784 ExecStartPost=/usr/bin/mysql-systemd-start post (code=exited, status=0/SUCCESS)

    Process: 4783 ExecStart=/usr/bin/mysqld_safe --basedir=/usr (code=exited, status=1/FAILURE)

    Process: 4771 ExecStartPre=/usr/bin/mysql-systemd-start pre (code=exited, status=0/SUCCESS)

    Main PID: 4783 (code=exited, status=1/FAILURE)

    Jun 13 15:47:14 li1382-238.members.linode.com systemd[1]: Failed to start MySQL Community Server.

    Jun 13 15:47:14 li1382-238.members.linode.com systemd[1]: Unit mysqld.service entered failed state.

    Jun 13 15:47:14 li1382-238.members.linode.com systemd[1]: mysqld.service failed.

    Jun 13 15:47:14 li1382-238.members.linode.com systemd[1]: mysqld.service holdoff time over, scheduling restart.

    Jun 13 15:47:14 li1382-238.members.linode.com systemd[1]: start request repeated too quickly for mysqld.service

    Jun 13 15:47:14 li1382-238.members.linode.com systemd[1]: Failed to start MySQL Community Server.

    Jun 13 15:47:14 li1382-238.members.linode.com systemd[1]: Unit mysqld.service entered failed state.

    Jun 13 15:47:14 li1382-238.members.linode.com systemd[1]: mysqld.service failed.

    / var/log/mysqld.log 里面的日志

    2018-06-13 15:35:05 3884 [Note] InnoDB: Waiting for purge to start

    2018-06-13 15:35:05 3884 [Note] InnoDB: 5.6.40 started; log sequence number 1625997

    2018-06-13 15:35:05 3884 [Note] Server hostname (bind-address): '*'; port: 3306

    2018-06-13 15:35:05 3884 [Note] IPv6 is available.

    2018-06-13 15:35:05 3884 [Note] - '::' resolves to '::';

    2018-06-13 15:35:05 3884 [Note] Server socket created on IP: '::'.

    2018-06-13 15:35:05 3884 [Note] /usr/sbin/mysqld: ready for connections.

    Version: '5.6.40' socket: '/var/lib/mysql/mysql.sock' port: 3306 MySQL Community Server (GPL) 180613 15:47:08 mysqld_safe Logging to '/var/log/mysqld.log'.

    180613 15:47:08 mysqld_safe A mysqld process already exists

    180613 15:47:09 mysqld_safe Logging to '/var/log/mysqld.log'.

    180613 15:47:10 mysqld_safe A mysqld process already exists

    180613 15:47:11 mysqld_safe Logging to '/var/log/mysqld.log'.

    180613 15:47:11 mysqld_safe A mysqld process already exists

    180613 15:47:12 mysqld_safe Logging to '/var/log/mysqld.log'.

    180613 15:47:12 mysqld_safe A mysqld process already exists

    180613 15:47:13 mysqld_safe Logging to '/var/log/mysqld.log'.

    180613 15:47:13 mysqld_safe A mysqld process already exists

    6 条回复    2018-06-14 18:04:07 +08:00
    JHerschel
        1
    JHerschel  
       2018-06-14 00:20:57 +08:00
    没看到 " mysqld_safe A mysqld process already exists "吗?
    yummybitcoin
        2
    yummybitcoin  
       2018-06-14 03:44:02 +08:00
    @JHerschel 请问我应该如何做呢?
    tan90
        3
    tan90  
       2018-06-14 07:05:17 +08:00
    kill 掉正在运行的 mysqld 进程再试下启动!
    JHerschel
        4
    JHerschel  
       2018-06-14 08:16:46 +08:00
    看三楼哒。
    GTim
        5
    GTim  
       2018-06-14 08:41:23 +08:00
    三楼正确,实操如下


    ps aux | grep mysql

    看看哪些进程在,然后

    kill [进程编号]
    kmdd33
        6
    kmdd33  
    OP
       2018-06-14 18:04:07 +08:00
    @GTim @tan90 @JHerschel 谢谢,已经解决
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   2893 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 23ms · UTC 13:46 · PVG 21:46 · LAX 05:46 · JFK 08:46
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.