mysql开机启动(Linux)

原由:电脑上装了虚拟机,虚拟机上有装有MySQL数据库,因为电脑每天都要开关机,第二天开机后还需要手动开启mysql服务,因为博主比较懒,故做成自动启动。
备注:生产中一般不会做成自动启动

步骤如下:
1,查看是否有mysql服务
[root@mysql1 ~]# chkconfig --list

2,进入mysql软件目录,复制mysql.server文件到 /etc/rc.d/init.d目录下
[root@mysql1 ~]# cd  /data/mysql/support-files
[root@mysql1 support-files]# cp  mysql.server  /etc/rc.d/init.d/mysql

3,给/etc/rc.d/init.d/mysql赋权可执行权限
[root@mysql1 support-files]# chmod  +x  /etc/rc.d/init.d/mysql

4,添加mysql服务
[root@mysql1 support-files]# chkconfig --add mysql

5,使mysql服务开机自启
[root@mysql1 support-files]# chkconfig --level 345 mysql on

6,reboot服务器,测试是否成功。

有些人只教上车,不教下车是要不得的,
备注:开机不自启
[root@mysql1 support-files]# chkconfig --level 345 mysql off


新闻名称:mysql开机启动(Linux)
文章源于:http://lszwz.com/article/geeidj.html

其他资讯

售后响应及时

7×24小时客服热线

数据备份

更安全、更高效、更稳定

价格公道精准

项目经理精准报价不弄虚作假

合作无风险

重合同讲信誉,无效全额退款