MENU

手动搭建LAMP环境

January 14, 2021 • Read: 145 • 笔记

系统为 centos7.6

1.安装 mysql8

#先卸载centos中自带的数据库
rpm -qa | grep mariadb
rpm -e --nodeps mariadb-libs-5.5.56-2.el7.x86_64
wget https://dev.mysql.com/get/mysql80-community-release-el7-1.noarch.rpm
rpm -vih mysql80-community-release-el7-1.noarch.rpm
yum install mysql-community-server
# 启动成功后
cat /var/log/mysqld.log | grep password   #输出密码
# 登录mysql修改用户密码
mysql -uroot -p
#修改root临时密码
ALTER USER 'root'@'localhost' IDENTIFIED BY 'pwd';
# 创建远程连接用户
create user username@'%' identified  by 'pwd';
# 给远程用户赋权,修改加密方式
grant all privileges on *.* to username@'%' with grant option;
# 修改远程用户密码
ALTER USER 'username'@'%' IDENTIFIED WITH mysql_native_password BY 'pwd';

2.安装 apache

yum install httpd

3.安装 php(这是 phph72,centos 自带的是 5.4)

yum install epel-release -y

rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
# 安装php以及相关拓展
yum -y install php72w php72w-cli php72w-fpm php72w-common php72w-devel php72w-embedded php72w-gd php72w-mbstring php72w-mysqlnd php72w-opcache php72w-pdo php72w-xml
Last Modified: January 25, 2021
Archives QR Code
QR Code for this page
Tipping QR Code