N
N
Nikita Dergachov2021-03-16 16:37:37
Continuous Integration
Nikita Dergachov, 2021-03-16 16:37:37

How to set up MariaDB on CircleCI?

Can't set up MariaDB to work in CircleCi. For some reason, when starting the database, mysql works, not mariaDB.

jobs:
    test:
        name: Tests (PHP ${{ matrix.php-versions }})
        runs-on: ubuntu-latest

        env:
            DB_USERNAME: root
            DB_PASSWORD: root
            DB_CHARSET: utf8
            DB_COLLATE: utf8_unicode_ci
            DB_NAME: test
            VPNC_ENABLED: 0

        services:
            mysql:
                image: circleci/mariadb:latest
                env:
                    MYSQL_ALLOW_EMPTY_PASSWORD: false
                    MYSQL_ROOT_PASSWORD: root
                ports:
                    - 3306/tcp

        steps:
            - name: Start mysql service
              run: sudo /etc/init.d/mysql start

            - name: Test version
              run: mysql --version

            - name: Create test database
              run: mysql -u${DB_USERNAME} -p${DB_PASSWORD} --port=${DB_PORT} -e "CREATE DATABASE \`${DB_NAME}\` DEFAULT CHARACTER SET ${DB_CHARSET} DEFAULT COLLATE ${DB_COLLATE}"
              env:
                  DB_PORT: ${{ job.services.mysql.ports['3306'] }}

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question