開機自啟 Linux下設定MySql自動啟動

2021-09-11 15:24:28 字數 444 閱讀 7799

1、將服務檔案拷貝到init.d下,並重命名為mysql

cp /usr/local/mysql/support-files/mysql.server /etc/init.d/mysqld
2、賦予可執行許可權

chmod +x /etc/init.d/mysqld
3、新增服務

chkconfig --add mysqld
4、顯示服務列表

chkconfig --list
如果看到mysql的服務,並且3,4,5都是on的話則成功,如果是off,則鍵入

chkconfig --level 345 mysqld on
5、重啟電腦

reboot
6、驗證

netstat -na | grep 3306
如果看到有監聽說明服務啟動

Linux下設定Redis開機自啟

1 設定redis.conf 中daemonize 為yes 確保守護程序開啟。2 vi etc init.d redis 內容如下,然後儲存退出。chkconfig 2345 10 90 description start and stop redis path usr local bin sbi...

Linux下設定Nginx開機自啟

1 本地環境 root dev cat etc redhat release centos linux release 7.5.1804 core 2 在 etc init.d建立nginx檔案,並新增如下內容 root dev vim etc init.d nginx指令碼內容如下 esac3 儲...

開機自啟 Linux下設定MySql自動啟動

1 將服務檔案拷貝到init.d下,並重命名為mysql cp usr local mysql support files mysql.server etc init.d mysqld2 賦予可執行許可權 chmod x etc init.d mysqld3 新增服務 chkconfig add m...