日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 > 运维知识 > 数据库 >内容正文

数据库

ubuntu安装Redis+安装mysql(配置远程登录)+安装jdk+安转nginx+安转teamviewer+安装terminator+安装sublime

發(fā)布時間:2024/7/23 数据库 40 豆豆
生活随笔 收集整理的這篇文章主要介紹了 ubuntu安装Redis+安装mysql(配置远程登录)+安装jdk+安转nginx+安转teamviewer+安装terminator+安装sublime 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.

一.Ubuntu 安裝 Redis

sudo apt-get update
sudo apt-get install redis-server

redis-server 啟動

修改redis配置 遠程訪問:

sudo vim /etc/redis/redis.conf

注釋掉本機ip: 有坑的地方

#bind 127.0.0.1 

service redis-server restart

redis-cli ping 驗證可以ping通

問題:redis too many open files

解決:ulimit -n 10000

/etc/redis/redis.conf 增加maxclients個數(shù)

?

二.ubuntu安裝mysql

1. 安裝

sudo?apt-get?install?mysql-server mysql-client

service mysql restart 啟動mysql服務(wù)

?mysql -V查看版本

2.指定時區(qū):

2.1 mysql -u root -p 登錄mysql

2.2 show variables like '%time_zone%';

2.3?set global time_zone='+8:00';

2.4 退出重新登錄 show variables like '%time_zone%';

3.設(shè)置遠程登錄 mysql5.7

3.1 mysql -u root -p 登錄mysql

3.2?use?mysql; ??

3.3 GRANT?ALL?ON?*.*?TO?user@'%'?IDENTIFIED?BY?'123456'?WITH?GRANT?OPTION; ??

#這句話的意思?,允許任何IP地址(上面的?%?就是這個意思)的電腦?用user帳戶??和密碼(123456)來訪問這個MySQL?Server ??#必須加類似這樣的帳戶,才可以遠程登陸。?root帳戶是無法遠程登陸的,只可以本地登陸 .

3.4 最后最坑的一個地方

sudo vim /etc/mysql/mysql.conf.d/mysqld.cnf

在這里屏蔽掉只能本地連接的地址

3.5 重啟mysql服務(wù) sudo /etc/init.d/mysql restart

?

4.刪除mysql:

 4.1 卸載

sudo apt-get remove mysql-*

 4.2 然后清理殘留的數(shù)據(jù)

dpkg -l |grep ^rc|awk '{print $2}' |sudo xargs dpkg -P

?

三.安裝jdk

1.sudo apt install openjdk-8-jre-headless

2.sudo apt install openjdk-8-jdk-headless

四.安轉(zhuǎn)nginx

安裝sudo apt-get install nginx

ps -ef | grep nginx 查看

日志:日志放在了/var/log/nginx中,分別是access.log和error.log,可以進行查看是否安裝成功,如有錯誤根據(jù)錯誤修改

啟動nginx

/etc/init.d/nginx start

卸載nginx

刪除nginx,–purge包括配置文件
sudo apt-get --purge remove nginx
自動移除全部不使用的軟件包
sudo apt-get autoremove

列出與nginx相關(guān)的軟件 并刪除顯示的軟件
dpkg --get-selections|grep nginx

sudo apt-get --purge remove nginx
sudo apt-get --purge remove nginx-common
sudo apt-get --purge remove nginx-core

再次執(zhí)行
dpkg --get-selections|grep nginx

which nginx # 不在顯示nginx
這樣就可以完全卸載掉nginx包括配置文件?
注意點:首先需要停止nginx的服務(wù)

sudo service nginx stop

nginx配置負載均衡

五.安轉(zhuǎn)teamviewer

網(wǎng)址https://www.teamviewer.com/zhcn/download/linux/

sudo dpkg -i teamviewer***.deb

sudo apt install -f

sudo apt install teamviewer***.deb

卸載:

apt purge teamviewer

六,安裝terminator

1.sudo apt-get install terminator

.cd ~/.config/terminator/ && sudo vim config? ?(配置)

[global_config]focus = systemsuppress_multiple_term_dialog = Truetitle_transmit_bg_color = "#d30102" [keybindings] [layouts][[default]][[[child1]]]parent = window0profile = defaulttype = Terminal[[[window0]]]parent = ""type = Window [plugins] [profiles][[default]]background_color = "#2d2d2d"background_darkness = 0.85background_image = Nonecopy_on_selection = Truecursor_color = "#ff0000"font = Ubuntu Mono 13foreground_color = "#eee9e9"palette = "#2d2d2d:#f2777a:#99cc99:#ffcc66:#6699cc:#cc99cc:#66cccc:#d3d0c8:#747369:#f2777a:#99cc99:#ffcc66:#6699cc:#cc99cc:#66cccc:#f2f0ec"scrollback_infinite = Trueshow_titlebar = Falseuse_system_font = False

3.若遇見閃退

是因為默認版本是python3,而其要依賴python2

sudo gedit /usr/share/terminator/terminator

將第一行的#!/usr/bin/python修改為#!/usr/bin/python2?

4.終端配置顏色

vim ~/.bashrc

在最后行添加

PS1='${debian_chroot:+($debian_chroot)}\[\033[01;35;40m\]\u\[\033[00;00;40m\]@\[\033[01;35;40m\]\h\[\033[00;31;40m\]:\[\033[00;00;40m\]\w \[\033[01;32;40m\]\$ \[\033[01;37;40m\]'

source ~/.bashrc

七,安裝sublime并可以寫入中文

1.安裝:

sudo add-apt-repository ppa:webupd8team/sublime-text-3

sudo apt-get update

sudo apt-get install sublime-text-installer

2.安裝中文字體:

git clone https://github.com/lyfeyaj/sublime-text-imfix.git

cd sublime-text-imfix

./sublime-imfix

?

總結(jié)

以上是生活随笔為你收集整理的ubuntu安装Redis+安装mysql(配置远程登录)+安装jdk+安转nginx+安转teamviewer+安装terminator+安装sublime的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯,歡迎將生活随笔推薦給好友。