腾讯云CentOS7.2 配置PHP7 MySQL
服务器系统 :CentOS7.2
查看系统版本:
cat /etc/centos-release //CentOS Linux release 7.2.1511 (Core)
删除之前的 php 版本:
yum remove php* php-common
rpm 安装 Php7 相应的 yum源
CentOS/RHEL 7.x:
rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
CentOS/RHEL 6.x:
rpm -Uvh https://mirror.webtatic.com/yum/el6/latest.rpm
直接yum安装php7:
yum install php70w
重启服务:
systemctl restart httpd.service
下为systemctl指令:
systemctl enable *.service #开机运行服务
systemctl disable *.service #取消开机运行
systemctl start *.service #启动服务
systemctl stop *.service #停止服务
systemctl restart *.service #重启服务
systemctl reload *.service #重新加载服务配置文件
systemctl status *.service #查询服务运行状态
systemctl --failed #显示启动失败的服务
安装MySQL:
下载mysql的repo源:
wget http://repo.mysql.com/mysql-community-release-el7-5.noarch.rpm
安装mysql-community-release-el7-5.noarch.rpm包:
sudo rpm -ivh mysql-community-release-el7-5.noarch.rpm
安装mysql:
sudo yum install mysql-server
开启MySQL:
systemctl start mysql
重置密码:
/bin/mysqladmin -u root -p password
//Enter password : 为空
//New password: 新密码
//Confirm new password: 新密码