Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

How to install docker, mysql, and nginx

Shulou Source: shulou.com Published: 2022-06-01 14:18:01 10月17日 Update

This article mainly introduces how to install docker, mysql and nginx, has a certain reference value, interested friends can refer to, I hope you can learn a lot after reading this article, the following let Xiaobian take you to understand.

First, install docker

# install Docker

Yum-y install docker

# start Docker backend service

Service docker start

# Test run hello-world

Docker run hello-world

If the following occurs, docker is installed successfully

Note: well, docker had better upgrade the kernel version, and it is best to use a system above centos7. There are ways to upgrade the kernel in my blog. I won't go into details about how to upgrade the kernel.

Second, install mysql:

Then only a few commands docker will be installed. The next step is to install mysql.

# install mysql:5.6 and docker run directly. He will automatically go to the official image to download.

# MYSQL_ROOT_PASSWORD= your database password docker run-- name mysql-p 3306 name mysql 3306-e MYSQL_ROOT_PASSWORD=123456-d mysql:5.6

# mysql installed by docker allows remote connections by default, and you can use software such as Navicat to connect to the database

# enter the container mysql docker exec-it mysql bash

# enter the database p followed by your password mysql-uroot-pXXX

# create a database (database name: solo; character set utf8mb4; collation utf8mb4_general_ci) create database solo DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci; # appears Query OK, 1 row affected (0.00 sec) indicates success

# exit database exit

# exit Container exit

Although mysql is installed in a docker container, it can also be connected using remote tools, such as Navicat.

Third, install nginx

Docker run-- name nginx-p 80:80-d-- rm nginx

A direct command is fine, and then enter your ip on the browser. If the following picture is displayed, it will prove that the installation is ready. It simply doesn't need too much money. It's convenient and fast.

Thank you for reading this article carefully. I hope the article "how to install docker, mysql and nginx" shared by the editor will be helpful to you. At the same time, I also hope you will support us and pay attention to the industry information channel. More related knowledge is waiting for you to learn!

Tags: Data database article kernel container upgrade success command password best face-to-face installed next item value interest blog at the same time background picture Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Microsoft Xiaomi Linux Shulou Tech Info Redmi