Fedora16 mysql
伺服器啟動
2012-03-10 16:32:50| 分類:
Linux/Unix |字型大小
訂閱
從Fedora16開始,Redhat不再推薦ntsysv、chkconfig、service,而是建議使用新的服務管理工具systemctl (貌似功能強大)
對比表,以 apache / httpd 為例
| 任務 |
舊指令 |
新指令 |
| 使某服務自動啟動 |
chkconfig --level 3 httpd on |
systemctl enable httpd.service
|
| 使某服務不自動啟動 |
chkconfig --level 3 httpd off |
systemctl disable httpd.service
|
| 檢查服務狀態 |
service httpd status |
systemctl status httpd.service (服務詳細資料) systemctl is-active httpd.service (僅顯示是否 Active)
|
| 顯示所有已啟動的服務 |
(誰知道?) |
systemctl list-units --type=service
|
| 啟動某服務 |
service httpd start |
systemctl start httpd.service
|
| 停止某服務 |
service httpd stop |
systemctl stop httpd.service
|
| 重啟某服務 |
service httpd restart |
systemctl restart httpd.service
|
mysql安裝:
yum install mysql mysql-server ##安裝mysql及mysql伺服器systemctl start mysqld.service ##啟動mysql伺服器 systemctl enable mysqld.service##使mysql伺服器自動運行mysqladmin -u root password '' ##設定root密碼為空白