Run Mysql in Docker

Надежный VDS
2 Просмотры
Поддержите сайт и поделитесь материалом в соц.сетях:

Издатель
This tutorial shows how to setup mysql in docker. Follow this tutorial to quickly setup mysql database in docker container. It can also be used with phpmyadmin.

Prerequisites
- Docker installed

Steps

1. Go to https://hub.docker.com/_/mysql and pull latest mysql image
docker pull mysql:8.0.27
or
docker pull mysql:latest

2. Run mysql in docker
docker run --name mysql-docker -p 3306:3306 -e MYSQL_ROOT_PASSWORD=mypassword -d mysql:8.0.27

3. Check mysql logs in docker container
docker logs mysql-docker -f

4. Connect to mysql within the docker container
docker exec -it mysql-docker bash
mysql -uroot -p

5. Connect to mysql from local mysql client
--install mysql client
sudo apt-get install mysql-client
--connect to mysql
mysql -uroot -h0.0.0.0 -p

Facebook : https://www.facebook.com/aveti.tutorial.9

Please like subscribe to this channel
Категория
Mysql
Комментариев нет.
Kwork.ru - услуги фрилансеров от 500 руб.