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,230 points
1,608 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,440 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 9, 2018 in Docker by Atul
• 10,240 points
22,687 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,360 points
6,144 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,090 points
2,426 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,440 points
754 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,340 points
109,660 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP