CentOS7安裝mariaDB、jdk1.8、redis資料庫例子

來源:互聯網
上載者:User


這個是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

[root@localhost redis-3.2.3]# ./utils/install_server.sh
Welcome to the redis service installer
This script will help you easily set up a running redis server

Please select the redis port for this instance: [6379] 6379
Please select the redis config file name [/etc/redis/6379.conf] /etc/redis/6379.conf
Please select the redis log file name [/var/log/redis_6379.log] /logs/redis/redis_6379.log
Please select the data directory for this instance [/var/lib/redis/6379]
Selected default - /var/lib/redis/6379
Please select the redis executable path [/usr/local/bin/redis-server] /usr/local/bin/redis-server
Selected config:
Port           : 6379
Config file    : /etc/redis/6379.conf
Log file       : /logs/redis/redis_6379.log
Data dir       : /var/lib/redis/6379
Executable     : /usr/local/bin/redis-server
Cli Executable : /usr/local/bin/redis-cli
Is this ok? Then press ENTER to go on or Ctrl-C to abort.
Copied /tmp/6379.conf => /etc/init.d/redis_6379
Installing service...
Successfully added to chkconfig!
Successfully added to runlevels 345!
Starting Redis server...
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);

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.