Linux中配置MySQL随系统的自动启动和关闭
Linux中配置MySQL和tomcat随系统的自动启动和关闭
1.MySQL启动同步:
在文件/etc/rc.local中添加如下:
sudo /usr/bin/mysqld_multi --defaults-extra-file=/home/mysql my_multi.cnf start 6
sudo /usr/bin/mysqld_multi --defaults-extra-file=/home/mysql/my_multi.cnf start 1-3
sudo /home/xug/Java/jira/bin/shutdown.sh
sudo rm -f /home/xug/Java/jira/data/.jira-home.lock
sudo /home/xug/Java/jira/bin/startup.sh
2.MySQL关闭同步:
在文件/etc/rc.d/rc.halt开头插入如下两行:
echo "Stopping MySQL Server"
/etc/rc.d/init.d/mysql.server stop