docs: update centos/software
This commit is contained in:
parent
ca6a394d17
commit
bd6a283086
@ -2,7 +2,7 @@
|
||||
title: 常用软件
|
||||
description: CentOS中常用软件的安装
|
||||
published: true
|
||||
date: 2021-08-03T08:44:11.452Z
|
||||
date: 2021-08-03T09:09:58.622Z
|
||||
tags: centos
|
||||
editor: markdown
|
||||
dateCreated: 2021-08-03T08:44:11.452Z
|
||||
@ -38,7 +38,80 @@ $ source /etc/profile
|
||||
```
|
||||
|
||||
# MySQL
|
||||
1.
|
||||
1. centos上默认是没有yum源的,yum安装的是 MariaDB。所以我们需要自己先配置yum源。
|
||||
- 访问:https://dev.mysql.com/downloads/repo/yum/
|
||||
- 下载:Red Hat Enterprise Linux 7 / Oracle Linux 7 (Architecture Independent), RPM Package
|
||||
2. 安装yum源
|
||||
|
||||
```shell
|
||||
$ rpm -Uvh mysql80-community-release-el7-3.noarch.rpm
|
||||
```
|
||||
|
||||
3. 查看有哪些版本的mysql,可以看到禁用和启用的版本,默认最新版本是开启的
|
||||
|
||||
```shell
|
||||
$ yum repolist all | grep mysql
|
||||
```
|
||||
|
||||
4. 修改安装版本
|
||||
|
||||
```shell
|
||||
$ vim /etc/yum.repos.d/mysql-community.repo
|
||||
```
|
||||
|
||||

|
||||

|
||||
|
||||
6. 查看安装的mysql
|
||||
|
||||
```shell
|
||||
$ rpm -qa | grep -i mysql
|
||||
```
|
||||
|
||||
7. 默认使用安装
|
||||
|
||||
```shell
|
||||
$ yum install -y mysql-community-server
|
||||
```
|
||||
|
||||
8. 启动mysql
|
||||
|
||||
```shell
|
||||
$ systemctl start mysqld
|
||||
```
|
||||
查看状态
|
||||
|
||||
```shell
|
||||
$ systemctl status mysqld
|
||||
```
|
||||
|
||||
9. 登录数据库,修改数据库密码
|
||||
mysql5.7的新特性之一就是在初始化的时候会生成一个自定义的密码,然后你需要找到这个密码,登录的时候输入。注意,输入密码的时候是不显示。
|
||||
|
||||
```shell
|
||||
grep 'temporary password' /var/log/mysqld.log
|
||||
```
|
||||
|
||||
登录数据库:这里-p之后不用输入密码,回车后再输入。改过密码之后登录则是直接在-p后加密码了。
|
||||
|
||||
```shell
|
||||
$ mysql -uroot -p
|
||||
```
|
||||
|
||||
修改密码
|
||||
*注意,修改的密码太简单会不给修改,把大小写字母和数字加上就肯定可以了。然后切记切记,mysql里面的命令要加分号!分号!分号!*
|
||||
|
||||
```
|
||||
SET PASSWORD = PASSWORD('Admin123!');
|
||||
```
|
||||
|
||||
10. 最后重启数据库,使配置生效。
|
||||
|
||||
11. 设置开机启动
|
||||
```bash
|
||||
$ systemctl enable mysqld
|
||||
$ systemctl daemon-reload
|
||||
```
|
||||
|
||||
# nginx
|
||||
1. 添加依赖
|
||||
|
Loading…
Reference in New Issue
Block a user