title: gitlab ci: mysql build and restore db dump
body: <p>in gitlab.yml I have </p>
  
  <pre><code>mysql_build:
    stage: build
    variables:
      MYSQL_DATABASE: rates
      MYSQL_ROOT_PASSWORD: root
    services:
    - mysql:latest
    image: mysql
    before_script:
    - mysql --version
    script:
    - echo "SELECT 'OK';" | mysql --user=root --password="${MYSQL_ROOT_PASSWORD}" --host=mysql "${MYSQL_DATABASE}"
    - mysql --user=root --password="${MYSQL_ROOT_PASSWORD}" rates &lt; db/rates_db.sql
  </code></pre>
  
  <p>it is install mysql successfully, but I want to restore sql dump file for accessing it in next stage.</p>
  
  <p>when started this part, I have exception:</p>
  
  <pre><code> - mysql --user=root --password="${MYSQL_ROOT_PASSWORD}" rates &lt; db/rates_db.sql
  
  ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
  </code></pre>
  
  <p>Real application located here </p>
  
  <p><a href="https://gitlab.com/armdev/exchange-rates" rel="nofollow noreferrer">https://gitlab.com/armdev/exchange-rates</a></p>
  
  <p>How can I restore db in mysql?</p>