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

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

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

安裝Mysql

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

1.在linux服務器/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.啟動并設置開機自啟: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服務器/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服務:./redis-server ../redis.conf

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

[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

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

9.查看redis服務狀態(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.啟動并設置開機自啟:systemctl start nginx、systemctl enable nginx

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

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

總結 

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

相關文章

最新評論

宕昌县| 江油市| 天峨县| 蒲城县| 肃宁县| 正宁县| 凤冈县| 集贤县| 威宁| 禹城市| 静安区| 黑龙江省| 潞城市| 视频| 玉田县| 托克托县| 丽江市| 开阳县| 容城县| 北碚区| 郓城县| 安仁县| 达州市| 康保县| 鄂州市| 马鞍山市| 天水市| 邢台市| 宜川县| 河北省| 陇川县| 从江县| 阿鲁科尔沁旗| 大化| 四平市| 丰宁| 抚顺市| 荣成市| 阿坝县| 衡阳市| 禹城市|