title: Import data.sql MySQL Docker Container
body: <p>If I have a data.sql, how I can import database to my mysql docker container? How I can import database data. In a dockerised world this adds a layer of complexity. some methods please.</p>
  
  <p>Here my docker-compose.yml:</p>
  
  <pre><code>nginx:
    build: ./nginx/
    container_name: nginx-container
    ports:
      - 80:80
    links:
      - php
    volumes_from:
      - app-data
  
  php:
    build: ./php/
    container_name: php-container
    expose:
      - 9000
    links:
      - mysql
    volumes_from:
      - app-data
  
  app-data:
    image: php:7.0-fpm
    container_name: app-data-container
    volumes:
      - ./www/html/:/var/www/html/
    command: "true"
  
  mysql:
    image: mysql:latest
    container_name: mysql-container
    ports:
      - 3306:3306
    volumes_from:
      - mysql-data
    environment:
      MYSQL_ROOT_PASSWORD: secret
      MYSQL_DATABASE: name_db
      MYSQL_USER: user
      MYSQL_PASSWORD: password
  
  mysql-data:
    image: mysql:latest
    container_name: mysql-data-container
    volumes:
      - /var/lib/mysql
    command: "true"
  </code></pre>