• 从0开始学CentOS7(2)---安装mariaDB、jdk1.8、redis


    继续前面的基础步骤~

    这个是centos7自带的数据库MariaDB,以前是mysql,到7以后,改为MariaDB。。。

    1. MariaDB安装,没有往深处配置。。。懒得动了。。参考:http://blog.csdn.net/default7/article/details/41973887

        a:yum install mariadb mariadb-server
    
        b:systemctl start mariadb ==> 启动mariadb
    
        c:systemctl enable mariadb ==> 开机自启动
    
        d:mysql_secure_installation ==> 设置 root密码等相关
    
        e:mysql -uroot -p123456 -h127.0.0.1 ==> 测试登录!

    2. jdk安装。

      参考地址:1. http://www.jb51.net/os/RedHat/73016.html

               2. http://blog.csdn.net/czmchen/article/details/41047187

      换汤不换药,三部曲;1. 下载,2.看装过没,3. 安装&配置环境

      rpm安装法,不会的去百度。。。很简单的。。上面参考的教程也有。

    3. redis 

      安装必要包:

    yum install gcc

      下载:ps:如果没有wget命令,执行:yum install wget;(这个方案是通用的,如果有命令没有安装,一般这种办法都可以安装出来的。。我挺喜欢这个功能的。。)

    wget http://download.redis.io/releases/redis-3.2.3.tar.gz

      解压:

    tar zxvf redis-3.2.3.tar.gz

      进入目录,分配内存:

       

     cd redis-3.2.3      # 进入目录
    
     make MALLOC=libc    # 不执行,会报错。

      配置系统启动:./utils/install_server.sh

     1 [root@localhost redis-3.2.3]# ./utils/install_server.sh
     2 Welcome to the redis service installer
     3 This script will help you easily set up a running redis server
     4 
     5 Please select the redis port for this instance: [6379] 6379
     6 Please select the redis config file name [/etc/redis/6379.conf] /etc/redis/6379.conf
     7 Please select the redis log file name [/var/log/redis_6379.log] /logs/redis/redis_6379.log
     8 Please select the data directory for this instance [/var/lib/redis/6379] 
     9 Selected default - /var/lib/redis/6379
    10 Please select the redis executable path [/usr/local/bin/redis-server] /usr/local/bin/redis-server
    11 Selected config:
    12 Port           : 6379
    13 Config file    : /etc/redis/6379.conf
    14 Log file       : /logs/redis/redis_6379.log
    15 Data dir       : /var/lib/redis/6379
    16 Executable     : /usr/local/bin/redis-server
    17 Cli Executable : /usr/local/bin/redis-cli
    18 Is this ok? Then press ENTER to go on or Ctrl-C to abort.
    19 Copied /tmp/6379.conf => /etc/init.d/redis_6379
    20 Installing service...
    21 Successfully added to chkconfig!
    22 Successfully added to runlevels 345!
    23 Starting Redis server...
    24 Installation successful!

    Redis服务查看、开启、关闭

    1、通过ps -ef|grep redis命令查看Redis进程;

    2、开启Redis服务操作通过/etc/init.d/redis_6379 start命令,也可通过(service redis_6379 start);

    3、关闭Redis服务操作通过/etc/init.d/redis_6379 stop命令,也可通过(service redis_6379 stop);

  • 相关阅读:
    10055
    国外程序员推荐:每个程序员都应该读的非编程书
    Volume 0. Getting Started
    如何成为一名 Google 软件工程师?【Google招聘信息】作者: 丁鑫哲
    毕设-家校通
    如何快速创建数据库连接字符串
    LeetCode day13
    LeetCode day12
    LeetCode day11
    LeetCode day10 Called it
  • 原文地址:https://www.cnblogs.com/Toolo/p/5777338.html
Copyright © 2020-2023  润新知