Centos7 搭建JDK/Mysql8/redis/Nginx全套傻瓜指令
# *******************安裝基礎*******************
# rpm -ivh jdk-8u202-linux-x64.rpm
# rpm -ivh tools/net-tools-*.rpm
# rpm -ivh ntp/*.rpm
# ntpdate ntp1.aliyun.com
# hwclock -w
# rpm -ivh perl/perl-*.rpm
# rpm -ivh telnet-0.17-66.el7.x86_64.rpm
# ***************安裝Redis********************
gcc -v
yum install -y gcc
rpm -ivh redis-7.0.3-1.el7.remi.x86_64.rpm
# 修改配置文件
vi /etc/redis.conf
daemonize yes
requirepass rds123456
# 重啟redis
systemctl restart redis
# 設置開機自啟
systemctl enable redis
# ********************安裝mysql********************
# 堅檢查是否有mysql
rpm -qa|grep mysql
rpm -e --nodeps mariadb-libs
cd mysql-8.0.29/
rpm -ivh mysql-community-common-8.0.29-1.el7.x86_64.rpm
rpm -ivh mysql-community-libs-8.0.29-1.el7.x86_64.rpm --force --nodeps
rpm -ivh mysql-community-client-8.0.29-1.el7.x86_64.rpm --force --nodeps
rpm -ivh mysql-community-server-8.0.29-1.el7.x86_64.rpm --force --nodeps
chown -R mysql:mysql /var/lib/mysql/
# 設置啟動
systemctl start ?mysqld
# 設置開機自啟
systemctl enable mysqld
cat /var/log/mysqld.log | grep password
# 記錄 A temporary password is generated for root@localhost: **********
# 設置密碼
alter user 'root'@'localhost' identified by 'bamBo0@Passw0rd';
CREATE DATABASE pkidb DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
# 外部訪問設置
use mysql;
update user set host='%' where user ='root';
flush privileges;
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%'WITH GRANT OPTION;
# 開放端口
firewall-cmd --permanent --add-port=3306/tcp
firewall-cmd --reload
# *********************安裝Nginx************************
rpm -ivh nginx-1.20.0-1.el7.ngx.x86_64.rpm
# 查看啟動狀態
systemctl status nginx
# 開啟nginx
systemctl start nginx
# 開機自啟
systemctl enable nginx
總結
以上是生活随笔為你收集整理的Centos7 搭建JDK/Mysql8/redis/Nginx全套傻瓜指令的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: python神经网络编程 代码,pyth
- 下一篇: 怎么样优化可以避免百度的冰桶算法?