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

来源:互联网 发布:淘宝优惠助手 编辑:程序博客网 时间:2024/05/01 19:50

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

a stop job is running for mysql community 


解决方案参考:https://askubuntu.com/questions/615129/systemd-mysql-wont-stop


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