无法将Go应用连接到mysql(都在gitlab运行程序中)

The go app simply inserts a harcoded value in a mysql table and spits it back out. This is done using this database driver. It works fine on linux servers, but during gitlab's CI this returns:

dial tcp 127.0.0.1:3306: connect: connection refused

This is the .gitlab-ci.yml

image: mysql
services:
  - mysql:latest
variables:
  MYSQL_DATABASE: storage
  MYSQL_ROOT_PASSWORD: root
  MYSQL_HOST: mysql
  MYSQL_USER: root
  MYSQL_TRANSAPORT: tcp
  MYSQL_ADDRESS: "127.0.0.1:3306"
job:
  script:
    - apt-get update -qq && apt-get install -qq curl && apt-get install -qq git
    - echo "SHOW GLOBAL VARIABLES LIKE 'PORT';" | mysql --user="$MYSQL_USER" --password="$MYSQL_ROOT_PASSWORD" --host="$MYSQL_HOST" "$MYSQL_DATABASE"
    - curl -O https://dl.google.com/go/go1.10.1.linux-amd64.tar.gz
    - tar -C /usr/local -xzf go1.10.1.linux-amd64.tar.gz
    - rm go1.10.1.linux-amd64.tar.gz
    - echo "export PATH=\$PATH:/usr/local/go/bin" >> ~/.bashrc
    - echo "export GOPATH=\$HOME/go" >> ~/.bashrc
    - echo "export PATH=\$PATH:\$GOPATH/bin" >> ~/.bashrc
    - source ~/.bashrc
    - go get github.com/go-sql-driver/mysql
    - go build main.go
    - ./main

Is there a standard way to use mysql from golang during CI?