腾讯云CentOS7.2 配置PHP7 MySQL 5.7.10

来源:互联网 发布:纳客软件如何 编辑:程序博客网 时间:2024/05/01 13:41

腾讯云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.rpmrpm -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: 新密码
0 0
原创粉丝点击