首先查看下自己系统的版本
安装Apache服务及其扩展包
yum -y install httpd httpd-manual mod_ssl mod_perl mod_auth_mysql
启动Apache服务
systemctl start httpd.service
浏览器查看是否安装启动成功
下载并安装MySQL官方的Yum Repository
rpm -e mariadb-libs --nodeps
yum install -y https://mirrors.aliyun.com/mysql/MySQL-5.7/mysql-community-common-5.7.35-1.el7.x86_64.rpm
yum install -y https://mirrors.aliyun.com/mysql/MySQL-5.7/mysql-community-libs-5.7.35-1.el7.x86_64.rpm
yum install -y https://mirrors.aliyun.com/mysql/MySQL-5.7/mysql-community-libs-compat-5.7.35-1.el7.x86_64.rpm
yum install -y https://mirrors.aliyun.com/mysql/MySQL-5.7/mysql-community-client-5.7.35-1.el7.x86_64.rpm
yum install -y https://mirrors.aliyun.com/mysql/MySQL-5.7/mysql-community-server-5.7.35-1.el7.x86_64.rpm
查看版本
启动 MySQL 数据库
systemctl start mysqld.service
查看MySQL初始密码
grep "password" /var/log/mysqld.log
登录数据库
mysql -uroot -p
修改密码安全策略为低
set global validate_password_policy=0;
修改密码
ALTER USER 'root'@'localhost' IDENTIFIED BY 'new password';
授予root用户远程管理权限
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY ' new password ';
安装PHP环境
yum -y install php php-mysql gd php-gd gd-devel php-xml php-common php-mbstring php-ldap php-pear php-xmlrpc php-imap
创建PHP测试页面
echo "<?php phpinfo(); ?>" > /var/www/html/phpinfo.php
创建phpMyAdmin数据存放目录
mkdir -p /var/www/html/phpMyAdmin
下载phpMyAdmin压缩包
wget --no-check-certificate
https://files.phpmyadmin.net/phpMyAdmin/4.0.10.20/phpMyAdmin-4.0.10.20-all-languages.zip
安装unzip并解压phpMyAdmin压缩包
yum install -y unzip
unzip phpMyAdmin-4.0.10.20-all-languages.zip
复制phpMyAdmin文件到数据存放目录
mv phpMyAdmin-4.0.10.20-all-languages/* /var/www/html/phpMyAdmin