阿里云CentOS系统环境配置

阿里云CentOS系统环境配置

MySQL

centos安装mysql

  1. 执行如下命令,更新YUM源。

rpm -Uvh [http://dev.mysql.com/get/mysql57-community-release-el7-9.noarch.rpm](http://dev.mysql.com/get/mysql57-community-release-el7-9.noarch.rpm?spm=a2c6h.12873639.article-detail.7.5aef255eJYTKv4&file=mysql57-community-release-el7-9.noarch.rpm)
  1. 执行如下命令,安装MySQL。

yum -y install mysql-community-server --nogpgcheck

  1. 执行如下命令,查看MySQL版本号。

mysql -V

  1. 执行如下命令,启动MySQL服务。

systemctl start mysqld

  1. 执行如下命令,设置MySQL服务开机自启动。

systemctl enable mysqld

  1. 配置MySQL的root用户密码。执行如下命令,查看/var/log/mysqld.log文件,获取root用户的初始密码。

grep 'temporary password' /var/log/mysqld.logmysql -uroot -p输入log中密码

  1. 执行以下命令,修改MySQL的root用户的初始密码。

    ALTER USER 'root'@'localhost' IDENTIFIED BY '12345678';

  2. 在MySQL中,密码策略分为四个级别:LOW、MEDIUM、STRONG、默认(默认是MEDIUM)。要将密码策略设置为LOW(只校验密码长度),可以使用以下命令:

    SET GLOBAL validate_password.policy = 0;
  3. 设置密码长度要求

    设置密码长度要求,确保密码至少为8位字符。您可以使用以下命令:

    SET GLOBAL validate_password.length = 8;
  4. 刷新权限

    刷新MySQL的权限以应用新的密码策略设置:

    FLUSH PRIVILEGES;

权限

Redis

yum安装redis

1.在centos系统上需要安装epel源

wget -O /etc/yum.repos.d/epel.repo https://mirrors.aliyun.com/repo/epel-7.repo centos7版本的

2.查看yum仓库redis版本

*yum info redis*

[root@master ~]# yum info redis
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
Installed Packages
Name        : redis
Arch        : x86_64
Version     : 3.2.12
Release     : 2.el7
Size        : 1.4 M
Repo        : installed
From repo   : epel
Summary     : A persistent key-value database
URL         : http://redis.io
License     : BSD
Description : Redis is an advanced key-value store. It is often referred to as a data
            : structure server since keys can contain strings, hashes, lists, sets and
            : sorted sets.
            : 
            : You can run atomic operations on these types, like appending to a string;
            : incrementing the value in a hash; pushing to a list; computing set
            : intersection, union and difference; or getting the member with highest
            : ranking in a sorted set.
            : 
            : In order to achieve its outstanding performance, Redis works with an
            : in-memory dataset. Depending on your use case, you can persist it either
            : by dumping the dataset to disk every once in a while, or by appending
            : each command to a log.
            : 
            : Redis also supports trivial-to-setup master-slave replication, with very
            : fast non-blocking first synchronization, auto-reconnection on net split
            : and so forth.
            : 
            : Other features include Transactions, Pub/Sub, Lua scripting, Keys with a
            : limited time-to-live, and configuration settings to make Redis behave like
            : a cache.
            : 
            : You can use Redis from most programming languages also.

3.yum安装并开启开机自启

*yum install redis**systemctl enable --now redis*

[root@master ~]# yum install redis
[root@master ~]# systemctl enable --now redis        #开启开机自启

4.查看redis是否成功启动

*ss -ntl*

  • 7
    点赞
  • 19
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

HalukiSan

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值