安装 mysql 关机_linux安装mysql后关机的时候经常死机

linux mint安装mysql后无法关机或者重启。reboot的时候总是停在mysql关闭的进程中。

a stop job is running for mysql community

had the same problem (upgrade to 15.04, using official files and config).

I had to make the following changes to be able to stop the mysql daemon manually with sytemctl and automatically on system reboot/shutdown:

Make /etc/mysql/debian.cnf readable for the mysql user with

sudo chgrp mysql /etc/mysql/debian.cnf; sudo chmod 640 /etc/mysql/debian.cnf

Provide a slightly modified mysql.service file:

sudo cp /lib/systemd/system/mysql.service /etc/systemd/system/

sudo chmod 755 /etc/systemd/system/mysql.service

Provide an explicit stop command by opening the copied file in an editor:

sudo nano /etc/systemd/system/mysql.service

and adding the following line under the [Service] section:

ExecStop=/usr/bin/mysqladmin --defaults-file=/etc/mysql/debian.cnf shutdown

In Nano, use Ctrl+O to save (Linux way!), Ctrl+X to exit.

Make the new service file known to system:

sudo systemctl daemon-reload

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值