1.查看防火牆狀態,如果開啟了,則將其關閉。
查看防火牆:
[root@localhost ~]# service iptables status
關閉防火牆:
[root@localhost ~]# service iptables stop
可以設置把防火牆永久關閉:
永久關閉防火牆:
chkconfig iptables off
開啟:
chkconfig iptables on
2.重啟系統
reboot
3.啟動mysql服務
[root@localhost ~]# service mysqld start
============================
設置開機啟動msql服務:
查看狀態:
[root@localhost ~]# chkconfig --list
mysqld 0:關閉 1:關閉 2:關閉 3:關閉 4:關閉 5:關閉 6:關閉
如果看到mysql的服務,並且3,4,5都是on的話則成功,如果是off,則鍵入
[root@localhost ~]# chkconfig --level 345 mysqld on
成功狀態:
[root@localhost ~]# chkconfig --list
mysqld 0:關閉 1:關閉 2:關閉 3:啟用 4:啟用 5:啟用 6:關閉
重啟(reboot)驗證:
[root@localhost ~]# service mysqld status
mysqld (pid 1617) 正在運行...