ubuntu 配置python,Redis,Mysql

配置ubuntu的Mysql,python,redis 等環境

博主的ubuntu版本爲Ubuntu 16.04.2 使用的是阿里雲服務器,也在亞馬遜跟騰訊配置過一下均爲可用狀態python

1 配置python的版本

將你的ubuntu中的包升級到最新.mysql

apt-get update

查看當前版本redis

python -V

切換版本sql

python2
sudo update-alternatives --install /usr/bin/python python /usr/bin/python2 100
python3
sudo update-alternatives --install /usr/bin/python python /usr/bin/python3 150

安裝pip模塊bootstrap

wget https://bootstrap.pypa.io/get-pip.py  --no-check-certificate
sudo python get-pip.py

2 安裝Redis並開啓遠程訪問

安裝Redisubuntu

apt-get install redis-server

開啓redis的遠程訪問安全

bind 0.0.0.0 # 將ip註釋掉或者改成0.0.0.0

配置redis認證密碼,增長安全畢竟不是本地訪問服務器

#requirepass foobared  找到這個
requirepass 123456   #去掉註釋並修改你想要的密碼

最有一部咱們須要從新啓動咱們的redis-server服務讓它的配置能夠運行ui

/etc/init.d/redis-server stop  #中止
/etc/init.d/redis-server start  #啓動
/etc/init.d/redis-server restart #重啓

3 安裝mysql,並開啓mysql的主從同步(配置騰訊雲的mysql服務器)

安裝Mysql ,過程當中須要你設置你的密碼,用戶名默認爲root阿里雲

apt-get install mysql-server

未完待續

相關文章
相關標籤/搜索