mysql in a docker container

I have struggled a lot to find a clear tutorial for installing and running mysql server inside a docker container.

Here are my steps

0. you must have docker installed and running

  1. Pull the mysql docker image
    $ sudo docker pull mysql/mysql-server:8.0.22
  2. Start the docker container.
    Note: on my linux box I already had installed mysql server 5.7 on port 3306 So that is why I am using my machines port 3308 to bind to the docker’s mysql container port 3306
    Start mysql container:
    `
$ sudo docker run --name=mysql8 -p 3308:3306 --restart on-failure -e MYSQL_ROOT_HOST='%' -e MYSQL_ROOT_PASSWORD='admin'   -d mysql/mysql-server:8.0.22
  • here we also specify a password for the root user
  • check if the container is up with docker ps

3. Connect the mysql server

$ mysql --host 127.0.0.1 --port 3308 -u root -p

Introduction to the history of the shell/console/terminal

Source:

https://www.linuxjournal.com/content/linux-command-line-interface-introduction-guide

Introduction

The Linux command line is a text interface to your computer.

Also known as
– shell,
– terminal,
– console,
– command prompt and many others, is a computer program intended to interpret commands.

Allows users to execute commands by manually typing at the terminal, or has the ability to automatically execute commands which were programmed in “Shell Scripts”.

A bit of history

The Bourne Shell (sh) was originally developed by Stephen Bourne while working at Bell Labs.

Released in 1979 in the Version 7 Unix release distributed to colleges and universities.

The Bourne Again Shell (bash) was written as a free and open source replacement for the Bourne Shell.

Given the open nature of Bash, over time it has been adopted as the default shell on most Linux systems.