Using Docker for Mysql database

Filia Brown
2 min readSep 23, 2021
Source: docker

Docker is like a ship that brings things, it could be furniture or maybe groceries, the ship is like our big program/ software that has many modules related to one another. As we know in VMware generation we called monolithic architecture which runs a big ship/ software which depends on each module/ part of the ship, can you imagine if one part/ module burned or collapse what will happen? Our ship shrinks or our big Software down meanwhile only one part of the ship is broken. Nowadays we have new architecture called microservices if one module broke we still could running a whole software. Here I am using docker and sharing my experience configuration database using docker.

Things you need:
1. Docker
2. Internet connectivity

Step:
1. Install Docker, you can google how to install docker on your OS
2. After that make a container
For more details here is the link
https://docs.docker.com/engine/reference/commandline/create/

3. Open terminal/ CMD
4. Make sure container is up “docker ps”,
if docker does not start yet “docker start (Container_name)”, or to stop
“docker stop (container_name)”

5. Install image which is our MySQL, you can run a specific MySQL version or using the latest MySQL version which docker provides.

Latest mysql
docker pull mysql

Spesific version
docker pull mysql:(version)

5. Now access MySQL with root user

TADAAHH your configuration using docker is finish.

if you want to import here the step:

  1. Make sure docker running
  2. Make sure Mysql is installed
  3. Using comment source in MySQL
    mysql> source (source_file.sql)

the usual will show error 2/ that’s mean the directory is incorrect. Here the things you should do

Source: StackOverflow Hadi Mir

That’s all the things I want to share. if you have any thought or comment please leave a message.

--

--

Filia Brown
0 Followers

All want to do share my experience and knowledge