docs: update centos/software

This commit is contained in:
Administrator 2021-08-03 09:21:01 +00:00 committed by John Smith
parent 21b66c4182
commit f4157a90b4

View File

@ -2,7 +2,7 @@
title: 常用软件安装 title: 常用软件安装
description: CentOS中常用软件的安装 description: CentOS中常用软件的安装
published: true published: true
date: 2021-08-03T09:12:12.432Z date: 2021-08-03T09:21:00.282Z
tags: centos tags: centos
editor: markdown editor: markdown
dateCreated: 2021-08-03T08:44:11.452Z dateCreated: 2021-08-03T08:44:11.452Z
@ -13,13 +13,13 @@ dateCreated: 2021-08-03T08:44:11.452Z
2. 上传到服务器 2. 上传到服务器
3. 复制到 /usr/jdk没有新建 3. 复制到 /usr/jdk没有新建
```shell ```bash
$ cp jdk-8u211-linux-x64.tar.gz /usr/jdk $ cp jdk-8u211-linux-x64.tar.gz /usr/jdk
``` ```
4. 修改配置文件 4. 修改配置文件
```linux ```bash
$ vim /etc/profile $ vim /etc/profile
``` ```
@ -33,7 +33,7 @@ export PATH=$PATH:${JAVA_HOME}/bin
6. 刷新配置变量 6. 刷新配置变量
```shell ```bash
$ source /etc/profile $ source /etc/profile
``` ```
@ -43,19 +43,19 @@ $ source /etc/profile
- 下载Red Hat Enterprise Linux 7 / Oracle Linux 7 (Architecture Independent), RPM Package - 下载Red Hat Enterprise Linux 7 / Oracle Linux 7 (Architecture Independent), RPM Package
2. 安装yum源 2. 安装yum源
```shell ```bash
$ rpm -Uvh mysql80-community-release-el7-3.noarch.rpm $ rpm -Uvh mysql80-community-release-el7-3.noarch.rpm
``` ```
3. 查看有哪些版本的mysql可以看到禁用和启用的版本默认最新版本是开启的 3. 查看有哪些版本的mysql可以看到禁用和启用的版本默认最新版本是开启的
```shell ```bash
$ yum repolist all | grep mysql $ yum repolist all | grep mysql
``` ```
4. 修改安装版本 4. 修改安装版本
```shell ```bash
$ vim /etc/yum.repos.d/mysql-community.repo $ vim /etc/yum.repos.d/mysql-community.repo
``` ```
@ -64,37 +64,37 @@ $ vim /etc/yum.repos.d/mysql-community.repo
6. 查看安装的mysql 6. 查看安装的mysql
```shell ```bash
$ rpm -qa | grep -i mysql $ rpm -qa | grep -i mysql
``` ```
7. 默认使用安装 7. 默认使用安装
```shell ```bash
$ yum install -y mysql-community-server $ yum install -y mysql-community-server
``` ```
8. 启动mysql 8. 启动mysql
```shell ```bash
$ systemctl start mysqld $ systemctl start mysqld
``` ```
查看状态 查看状态
```shell ```bash
$ systemctl status mysqld $ systemctl status mysqld
``` ```
9. 登录数据库,修改数据库密码 9. 登录数据库,修改数据库密码
mysql5.7的新特性之一就是在初始化的时候会生成一个自定义的密码,然后你需要找到这个密码,登录的时候输入。注意,输入密码的时候是不显示。 mysql5.7的新特性之一就是在初始化的时候会生成一个自定义的密码,然后你需要找到这个密码,登录的时候输入。注意,输入密码的时候是不显示。
```shell ```bash
grep 'temporary password' /var/log/mysqld.log grep 'temporary password' /var/log/mysqld.log
``` ```
登录数据库:这里-p之后不用输入密码回车后再输入。改过密码之后登录则是直接在-p后加密码了。 登录数据库:这里-p之后不用输入密码回车后再输入。改过密码之后登录则是直接在-p后加密码了。
```shell ```bash
$ mysql -uroot -p $ mysql -uroot -p
``` ```
@ -116,7 +116,7 @@ $ systemctl daemon-reload
# nginx # nginx
1. 添加依赖 1. 添加依赖
```shell ```bash
$ apt-get install gcc $ apt-get install gcc
$ apt-get install libpcre3 libpcre3-dev $ apt-get install libpcre3 libpcre3-dev
$ apt-get install zlib1g zlib1g-dev $ apt-get install zlib1g zlib1g-dev
@ -130,7 +130,7 @@ $ sudo apt-get install libssl-dev
3. 编译 3. 编译
```shell ```bash
# 进入nginx目录 # 进入nginx目录
$ /usr/local/nginx/nginx-1.13.7 $ /usr/local/nginx/nginx-1.13.7
# 执行命令 # 执行命令
@ -143,7 +143,7 @@ $ make install
4. 启动nginx 4. 启动nginx
```shell ```bash
# 进入nginx启动目录 # 进入nginx启动目录
$ cd /usr/local/nginx/sbin $ cd /usr/local/nginx/sbin
# 启动nginx # 启动nginx
@ -151,6 +151,6 @@ $ ./nginx
``` ```
# zip、unzip # zip、unzip
```shell ```bash
$ yum install -y zip unzip $ yum install -y zip unzip
``` ```