php 安装
yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm
yum install http://rpms.remirepo.net/enterprise/remi-release-6.rpm
yum install yum-utils
yum-config-manager --enable remi-php72
yum install php php-mcrypt php-cli php-gd php-curl php-mysql php-ldap php-zip php-fileinfo -y
php -v
yum -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
yum -y install https://rpms.remirepo.net/enterprise/remi-release-8.rpm
dnf -y install dnf-utils
yum erase php*
dnf module reset php
dnf module enable php:remi-7.4
dnf module install php:remi-7.4
php -v
mysql 安装
- 查看是否安装了旧版本
rpm -qa|grep mysql
- 如果安装,先删除
yum remove mysql mysql-server mysql-libs mysql-server;
find / -name mysql 将找到的相关东西delete掉;
rpm -qa|grep mysql(查询出来的东东yum remove掉)
- 安装新版本
去MySQL官网下载yum安装包 https://dev.mysql.com/downloads/repo/yum/
cd /usr/local/src
wget <copylink>
安装
rpm -ivh mysql80-community-release-el6-1.noarch.rpm
yum install mysql-server
查看是否安装成功
mysqladmin -V
开启mysql
service mysqld start
service mydqld status
登录
cat /var/log/mysqld.log // 获取初始密码
mysql -uroot -p
设置远程连接
- 开放mysql 访问端口
vi /etc/sysconfig/iptables
-A INPUT -m state --state NEW -m tcp -p tcp --dport 3306 -j ACCEPT
service iptables restart
- 修改mysql host
update user set host='%' where user='root' and host='localhost';
ALTER USER 'root'@'%' IDENTIFIED BY 'newpassword'; //修改密码
flush privileges; // 刷新权限
service mysqld restart;
到目前为止,远程连接就没问题了
解决navicat 11连接不上的问题
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'newpassword';
flush privileges;
最后远程服务器为mysql设置别名,方便登录
cd ~
vi .bashrc
alias mysql='mysql -uroot -p123456'
source .bashrc
nginx 安装,之前整理过了
https://blog.csdn.net/trdsmile/article/details/88912053
nginx 支持php
- 修改php的配置文件
vi /etc/php-fpm.d/www.conf
user = nginx
group = nginx
- 重启php-fpm
service php-fpm restart
- nginx 配置,参考window下的配置
https://blog.csdn.net/trdsmile/article/details/90410963