ubuntu16.04開機啓動mysql:mysql
一、執行sysv-rc-conf --level 2345 mysql on,若是提示沒有sysv-rc-conf命令,先下載sql
下載命令:sudo apt-get install sysv-rc-confubuntu
二、查看服務列表sysv-rc-conf --list mysql,若是看到2345都是on,則設置成功get
root@192:/home/bigdata# sysv-rc-conf --list mysql
mysql 0:off 1:off 2:on 3:on 4:on 5:on 6:offubuntu16.04
三、重啓reboot,檢驗msyql是否已經重啓,ps -ef|grep mysql,如出現下圖,說明重啓成功io
root@192:/home/bigdata# ps -ef|grep mysql
mysql 24747 1 0 10月18 ? 00:01:18 /usr/sbin/mysqld
root 24858 20869 0 10月18 pts/8 00:00:00 sudo mysql_secure_installation
root 24859 24858 0 10月18 pts/8 00:00:00 mysql_secure_installation
root 54018 20869 0 10:47 pts/8 00:00:00 vi /etc/mysql/my.cnf
root 54123 54102 0 10:49 pts/9 00:00:00 grep --color=auto mysql下載