configure mysql database using docker-compose

0 votes

Hi Guys,

I am new in docker-compose. Can anybody help me, how can I configure mysql database container using docker-compose?

Apr 14, 2020 in Docker by akhtar
• 38,180 points
646 views

1 answer to this question.

0 votes

Hi@akhtar,

To configure mysql database using docker-compose, you have to use yml language to write your code. Here is an example given bellow.

version: '3'
services:
   mysql:
      image: mysql:latest
      environment:
        MYSQL_ROOT_PASSWORD: redhat
        MYSQL_USER: username
        MYSQL_PASSWORD: password
      restart: always
$ docker-compose up

It will create one mysql container.

answered Apr 14, 2020 by MD
• 95,140 points
What do we mean by creating mysql container? Do we embedded database data also in it? Or it’s just an databse with empty data? I’ve been put up confused now.
This will create a database server. You can connect this container from a client.

Related Questions In Docker

+1 vote
5 answers

Set containers timezones by using docker compose.

version "2" services: serviceA: ...READ MORE

answered Jul 8, 2018 in Docker by Atul
• 10,240 points
12,400 views
0 votes
1 answer

Interactive shell using Docker Compose

You need to include the following lines ...READ MORE

answered Jul 26, 2018 in Docker by Kalgi
• 52,310 points
4,256 views
0 votes
1 answer
+2 votes
1 answer
+2 votes
1 answer

Deploy Docker Containers from Docker Cloud

To solve this problem, I followed advice ...READ MORE

answered Sep 3, 2018 in AWS by Priyaj
• 58,100 points
1,116 views
0 votes
1 answer

How to configure wordpress tool using docker-compose?

Hi@akhtar, You can download wordpress image from docker hub. WordPress is ...READ MORE

answered Apr 24, 2020 in Docker by MD
• 95,140 points
219 views
+3 votes
4 answers

How do I execute multiple commands using docker-compose

It can be solve by using bash -c ...READ MORE

answered Sep 20, 2018 in Docker by shubham
• 7,320 points
67,174 views