f4T1H21 / mysql-docker-oneliner

A one-line bash script that pulls, starts and connects to MySQL container in Docker.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

MySQL Docker One-Liner

This bash script first pulls mysql:latest docker image if you don't have. Once you have the mysql docker image, it runs two different containers simultaneously where one of them is a MySQL server and the other is an interactive MySQL client which connects back to the server. After you exit MySQL, the client container will be killed and removed as well as the server container. Therefore do not try to develop projects on both containers because they won't exist after you exit!

Use Side

If you are working on database behaviours or learning MySQL and want containers and processes to be cleaned up automatically after the work, this one-liner script is definitely for you!

Dependencies:

Getting started:

$ git clone https://github.com/f4T1H21/mysql-docker-oneliner
$ cd mysql-docker-oneliner
$ chmod +x mysql-oneliner.sh
$ ./mysql-oneliner.sh

PoC:

PoC


─ Written by Şefik Efe ─

About

A one-line bash script that pulls, starts and connects to MySQL container in Docker.

License:GNU General Public License v3.0


Languages

Language:Shell 100.0%