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 in Docker by akhtar
• 10,580 points
163 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 by MD
• 23,050 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
6,185 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
• 51,850 points
2,290 views
+1 vote
3 answers

How do I execute multiple commands using docker-compose

You can also use the depends_on option ...READ MORE

answered Apr 22, 2019 in Docker by Kavya
35,443 views
0 votes
1 answer
0 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
• 57,530 points
538 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 in Docker by MD
• 23,050 points
88 views
0 votes
1 answer

load balancing using dns server in docker container.

Hi@akhtar, There are lots of platform which is ...READ MORE

answered Apr 16 in Docker by MD
• 23,050 points
49 views