Linux 設定mysql開機自啟動

2021-09-11 06:21:18 字數 619 閱讀 1491

1、確認/etc/init.d/mysql檔案是否存在:如果不存在則去mysql安裝檔案中複製乙個

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

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

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

chkconfig --list
5、設定mysql的服務3,4,5狀態為on

chkconfig --level 345 mysql on
6、重啟伺服器

reboot或者shutdown -r now
7、驗證mysql服務是否啟動

看到如圖則說明啟動成功

Linux 設定開機自啟

忘記 的 的。方法 1 這種方法會利用 etc 中的 rc.local 檔案來在啟動時執行指令碼與命令。我們在檔案中加上一行來執行指令碼,這樣每次啟動系統時,都會執行該指令碼。不過我們首先需要為 etc rc.local 新增執行許可權,sudo chmod x etc rc.local 然後將要執...

Linux環境下設定mysql開機自啟

1,將服務檔案複製乙份到init.d下,並重命名為mysqld cp usr local mysql support files mysql.server etc init.d mysqld2,對檔案賦予執行許可權 chmod x etc init.d mysqld 或 chmod 777 etc ...

mysql5 6設定linux開機自啟

1,將服務檔案複製乙份到init.d下,並重命名為mysqld cp usr local mysql support files mysql.server etc init.d mysqld 2,對檔案賦予執行許可權 chmod x etc init.d mysqld 或 chmod 777 etc...