Home > Database > Mysql Tutorial > Linux中配置MySQL随系统的启动和关闭同步

Linux中配置MySQL随系统的启动和关闭同步

WBOY
Release: 2016-06-07 16:52:00
Original
966 people have browsed it

1.MySQL启动同步:在文件/etc/rc.d/rc.local中添加如下两行:echo quot;Starting MySQL Serverquot;/etc/rc.d/init.d/mysql.ser

1.MySQL启动同步:
在文件/etc/rc.d/rc.local中添加如下两行:
echo "Starting MySQL Server"
/etc/rc.d/init.d/mysql.server start

2.MySQL关闭同步:
在文件/etc/rc.d/rc.halt开头插入如下两行:
echo "Stopping MySQL Server"
/etc/rc.d/init.d/mysql.server stop

说明:
1.文件/etc/rc.d/init.d/mysql.server是从mysql的安装子目录support-files下拷贝过来的;

2.由于mysql.server默认认为mysql安装于目录/usr/local/mysql下,如果你的mysql不是安装在这个目录下,请创建符合链接,比如:

ln -s /var/log/bak/mysql-5.0.51a-linux-i686-glibc23/ /usr/local/mysql

3.这种方式配置的服务随系统的启动和关闭同步,适用于IPCop等应用及其精简的系统,,不适于一般的发行版,因为一般的发行版是在/etc/rc.d/rc3.d/、/etc/rc.d/rc0.d/和/etc/rc.d/rc6.d/中的脚本来同步服务的启动和关闭。 

linux

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template