saberwy

导航

< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

统计

安装CentOS7、mysql和redis

一、U盘安装CentOS7,进BIOS修改u盘启动。

修改启动:

setparams  'Install CentOS linux 7'
linuxefi  /images/pxeboot/vmlinuz  linux dd  nomodeset quiet
initrdefi  /images/pxeboot/initrd .img
查看U盘的名称:如dbs4
则重启修改为:
setparams  'Install CentOS Linux 7'
linuxefi  /images/pxeboot/vmlinuz  inst.stage2=hd: /dev/sdb4  nomodeset quiet
initrdefi  /images/pxeboot/initrd .img
ctrl+X执行
 
 
二、安装MySQL
1.首先卸载系统自带的mysql
  rpm -qa|grep -i mysql
  查看mysql安装的东西
  rpm -ev --nodeps 上面查出来的
  再次执行
  rpm -qa|grep -i mysql
2.安装MySQL
  获取数据源

  wget https://dev.mysql.com/get/mysql57-community-release-el7-9.noarch.rpm

  进行yum源安装

  rpm -ivh mysql57-community-release-el7-9.noarch.rpm

  使用yum命令安装mysql

  yum -y install mysql-server

3.启动数据库

  启动mysql

  systemctl start mysqld

  查看mysql状态

  systemctl status mysqld

4.获取到临时密码

  grep 'temporary password' /var/log/mysqld.log

5.使用临时密码登入mysql

  mysql -u root -p

6.修改密码(密码必须满足:大小写字母、特殊符号、数字)

  ALTER USER 'root'@'localhost' IDENTIFIED BY '新的密码';

7.操作数据库

  show databases;

 

三、安装redis(使用这种方法安装redis不容易发生错误。使用源码安装make时可能会出现一些错误)
1.安装数据源
  yum install -y http://rpms.famillecollet.com/enterprise/remi-release-7.rpm
2.安装
  yum install redis
3.启动redis服务
  systemctl start radis
4.查看redis状态

 5.设置开机自启动

  systemctl enable redis.service

6.查看redis版本

  redis-cli --version

7.开启远程登录

  cd /etc

  vim redis.conf

  查找到bind 127.0.0.1修改成bind 0.0.0.0

8.关闭防火墙和防火墙开机自启动

  systemctl disable firewalld  (关闭自启动)

  systemctl stop firewalld  (关闭防火墙)

9.连接redis

  redis-cli

 

 

posted on   saberwy  阅读(457)  评论(0编辑  收藏  举报

编辑推荐:
· 10年+ .NET Coder 心语,封装的思维:从隐藏、稳定开始理解其本质意义
· .NET Core 中如何实现缓存的预热?
· 从 HTTP 原因短语缺失研究 HTTP/2 和 HTTP/3 的设计差异
· AI与.NET技术实操系列:向量存储与相似性搜索在 .NET 中的实现
· 基于Microsoft.Extensions.AI核心库实现RAG应用
阅读排行:
· 阿里巴巴 QwQ-32B真的超越了 DeepSeek R-1吗?
· 【译】Visual Studio 中新的强大生产力特性
· 10年+ .NET Coder 心语 ── 封装的思维:从隐藏、稳定开始理解其本质意义
· 【设计模式】告别冗长if-else语句:使用策略模式优化代码结构
· 字符编码:从基础到乱码解决
点击右上角即可分享
微信分享提示