How make mysql start automatically ? (linux-cli only)

前端 未结 9 1597
没有蜡笔的小新
没有蜡笔的小新 2020-12-23 12:43

How can i make mysql start every time the system boot ? I need that in a dedicated server(ubuntu distro) in which i have my blog, but every time the server goes down, on boo

9条回答
  •  自闭症患者
    2020-12-23 13:14

    Another place to look for clues as to what is and isn't starting at boot time...

    /etc/init.d/.depend.start (and its buddy at shutdown time, .depend.stop)

    Here's a little more info http://www.pyenet.co.nz/2-202-1-customising-system-startup-and-boot-processes/

    I had 2 servers - after booting, 1 would have mysql running, the other not so much.

    On the box where mysql was starting at boot time:

    • chkconfig wasn't even installed
    • there were zero links from any scripts in /etc/rc?.d/* back to /etc/init.d/mysql
    • BUT... /etc/init.d/.depend.start contained:

      TARGETS = halt apache2 umountfs umountnfs.sh sendsigs networking umountroot reboot killprocs unattended-upgrades urandom mysql mdadm dns-clean landscape-client pppd-dns sysstat rsync sudo postfix single grub-common ondemand rc.local
      INTERACTIVE = apache2
      postfix: mysql
      single: killprocs dns-clean pppd-dns
      grub-common: apache2 unattended-upgrades postfix mysql mdadm dns-clean landscape-client pppd-dns sysstat rsync sudo
      ondemand: apache2 unattended-upgrades postfix mysql mdadm dns-clean landscape-client pppd-dns sysstat rsync sudo
      rc.local: apache2 unattended-upgrades postfix mysql mdadm dns-clean landscape-client pppd-dns sysstat rsync sudo
      

    When I simply copied this file over to the problem server, and rebooted, mysql was up & running.

提交回复
热议问题