使用 LNMP 如何禁止mysql启动?

找到目录 /usr/bin/lnmp,找到 mysql相关 的命令注释即可,修改如下:

#!/bin/bash
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
export PATH

# Check if user is root
if [ $(id -u) != "0" ]; then
    echo "Error: You must be root to run this script!"
    exit 1
fi

echo "+-------------------------------------------+"
echo "|    Manager for LNMP, Written by Licess    |"
echo "+-------------------------------------------+"
echo "|              http://lnmp.org              |"
echo "+-------------------------------------------+"

PHPFPMPIDFILE=/usr/local/php/logs/php-fpm.pid

arg1=$1
arg2=$2

lnmp_start()
{
    echo "Starting LNMP..."
    /etc/init.d/nginx start
    #/etc/init.d/mysql start
    /etc/init.d/php-fpm start
}

lnmp_stop()
{
    echo "Stoping LNMP..."
    /etc/init.d/nginx stop
    #/etc/init.d/mysql stop
    /etc/init.d/php-fpm stop
}

lnmp_reload()
{
    echo "Reload LNMP..."
    /etc/init.d/nginx reload
    #/etc/init.d/mysql reload
    /etc/init.d/php-fpm reload
}

lnmp_kill()
{
    echo "Kill nginx,php-fpm,mysql process..."
    killall nginx
    #killall mysqld
    killall php-fpm
    killall php-cgi
    echo "done."
}

lnmp_status()
{
    /etc/init.d/nginx status
    if [ -f $PHPFPMPIDFILE ]; then
        echo "php-fpm is runing!"
    else
        echo "php-fpm is stop!"
    fi
    /etc/init.d/mysql status
}
。。。。。。

你可能感兴趣的:(Linux)