騰訊雲CentOS7.2 配置PHP7 MySQL
伺服器系統 :CentOS7.2
檢視系統版本:
cat /etc/centos-release //CentOS Linux release (Core)
- 1
删除之前的 php 版本:
- 1
rpm 安裝 Php7 相應的 yum源
CentOS/RHEL 7.x:
rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-noarch.rpm
rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
- 1
- 2
CentOS/RHEL 6.x:
- 1
直接yum安裝php7:
yum install php70w
- 1
重新開機服務:
- 1
下為systemctl指令:
systemctl enable *.service #開機運作服務
systemctl disable *.service #取消開機運作
systemctl start *.service #啟動服務
systemctl stop *.service #停止服務
systemctl restart *.service #重新開機服務
systemctl reload *.service #重新加載服務配置檔案
systemctl status *.service #查詢服務運作狀态
systemctl --failed #顯示啟動失敗的服務
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
安裝MySQL:
下載下傳mysql的repo源:
- 1
安裝mysql-community-release-el7-5.noarch.rpm包:
sudo rpm -ivh mysql-community-release-el7-noarch.rpm
- 1
安裝mysql:
sudo yum install mysql-server
- 1
開啟MySQL:
- 1
重置密碼:
/bin/mysqladmin -u root -p password
//Enter password : 為空
//New password: 新密碼
//Confirm new password: 新密碼