Ubuntu下禁止MySQL自動啟動

來源:互聯網
上載者:User

遇到這個問題很頭疼,發現以前的辦法不行了,就從網上尋找到新的解決辦法,現轉一些:

在Ubuntu 10.04(或更早一點)開始,Ubuntu使用Upstart替代傳統的/sbin/init在啟動的同時運行服務和設定的任務。Ubuntu 10.04下,用apt安裝的mysql,便是使用了upstart的啟動方式。安裝後預設的mysql在系統啟動時會自動啟動,停止自動啟動的方法很簡單,sudo編輯/etc/init/mysql.conf,把其中的start節點:

...
start on (net-device-up
          and local-filesystems
         and runlevel [2345])

改為:

...
start on runlevel [!0123456]
這樣便取消了mysql在開機時的自動啟動。

相關文章

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.