最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

Linux上安裝Mysql、Redis、Nginx的詳細步驟記錄

 更新時間:2025年04月27日 08:31:43   作者:咸魚吐泡泡  
這篇文章主要介紹了Linux上安裝Mysql、Redis、Nginx的詳細步驟,包括下載、安裝、配置和設(shè)置開機自啟等過程,文中通過代碼介紹的非常詳細,需要的朋友可以參考下

安裝Mysql

在下載Mysql之前確保Linux上面的Mysql徹底刪除干凈,不知道怎么刪除的去搜chatGpt。

1.在linux服務(wù)器/usr/local目錄下面創(chuàng)建mysql目錄:mkdir -p /usr/local/mysql,并進入到該目錄

2.下載官方Mysql:

wget https://dev.mysql.com/get/mysql80-community-release-el7-11.noarch.rpm

3.安裝這個repo包:rpm -ivh mysql80-community-release-el7-11.noarch.rpm

4.安裝Mysql8:yum install mysql-community-server

5.啟動并設(shè)置開機自啟:systemctl start mysqld、systemctl enable mysqld

6.查看初始密碼:grep 'temporary password' /var/log/mysqld.log

7.使用這個初始密碼登錄mysql:mysql -u root -p'初始密碼'

8.修改登錄密碼:ALTER USER 'root'@'localhost' IDENTIFIED BY 'MyNewPassw0rd!';

9.允許遠程IP登錄:update mysql.user set Host ='%' where User = 'root';

10.防火墻中添加3306端口:firewall-cmd --permanent --add-port=3306/tcp

11.重新加載防火墻配置讓其生效:firewall-cmd --reload

12.驗證3306端口是否添加到防火墻:firewall-cmd --list-ports

安裝Redis 

本方法是以源碼的方式安裝Redis,在安裝Redis之前確保Linux上面的Redis徹底刪除干凈,不知道怎么刪除的去搜chatGpt。

1.進入linux服務(wù)器/usr/local目錄:cd /usr/local

2.安裝依賴:install -y gcc tcl

3.下載Redis源碼:curl -O http://download.redis.io/releases/redis-6.2.7.tar.gz

4.解壓并重名了目錄:tar -zxvf redis-6.2.7.tar.gz、mv redis-6.2.7 redis

5.編譯二進制文件:cd redis、make、make PREFIX=/usr/local/redis install

6.修改redis配置文件:將daemonize no改為 daemonize yes、requirepass 密碼、注釋掉bind 127.0.0.1 -::1

7.進入/usr/local/redis/bin運行Redis服務(wù):./redis-server ../redis.conf

8.設(shè)置redis服務(wù)開機自啟:創(chuàng)建systemd服務(wù)文件vim /etc/systemd/system/redis.service,添加一下內(nèi)容:

[Unit]
Description=Redis In-Memory Data Store
After=network.target

[Service]
Type=forking
ExecStart=/usr/local/redis/bin/redis-server /usr/local/redis/redis.conf
ExecStop=/usr/local/redis/bin/redis-cli -a 你的密碼 shutdown
Restart=always
User=root
Group=root

[Install]
WantedBy=multi-user.target

重新加載服務(wù)配置systemctl daemon-reexec、systemctl daemon-reload,啟動redis服務(wù)并設(shè)置開機自啟systemctl start redis、systemctl enable redis

9.查看redis服務(wù)狀態(tài):systemctl status redis

安裝Nginx

在下載Nginx之前確保Linux上面的Nginx徹底刪除干凈,不知道怎么刪除的去搜chatGpt。

1.創(chuàng)建/usr/local/nginx目錄,并進入該目錄:mkdir -p /usr/local/nginx、cd /usr/local/nginx

2.下載官方Nginx安裝包:wget http://nginx.org/packages/centos/7/x86_64/RPMS/nginx-1.24.0-1.el7.ngx.x86_64.rpm

3.安裝rpm包:yum install -y ./nginx-1.24.0-1.el7.ngx.x86_64.rpm

4.啟動并設(shè)置開機自啟:systemctl start nginx、systemctl enable nginx

5.開放80端口:firewall-cmd --permanent --add-port=80/tcpfirewall-cmd --reload

6.驗證是否安裝成功:在瀏覽器中輸入服務(wù)器ip

總結(jié) 

到此這篇關(guān)于Linux上安裝Mysql、Redis、Nginx的文章就介紹到這了,更多相關(guān)Linux安裝Mysql、Redis、Nginx內(nèi)容請搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!

相關(guān)文章

最新評論

平定县| 祥云县| 永康市| 灵寿县| 育儿| 名山县| 太和县| 临江市| 中西区| 卢湾区| 桑植县| 长宁区| 丁青县| 琼海市| 枣强县| 姜堰市| 博白县| 元朗区| 垫江县| 瑞金市| 九龙城区| 怀化市| 曲阳县| 中超| 车险| 银川市| 彝良县| 沽源县| 大同市| 贵港市| 潼关县| 耿马| 翼城县| 手游| 古浪县| 舒兰市| 忻城县| 平山县| 冷水江市| 察雅县| 南宫市|