How to disable MySQL strict mode in CircleCI 2

mysql

#1

I’ve tried numerous things but I can’t get it to work. I want these specific modes to be set for my MySQL docker image. How do I do this?

IGNORE_SPACE,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION

This is my base CircleCI file with the images I’m using:

version: 2
jobs:
  build:
    docker:
      - image: php:7.1.1
      - image: mysql:5.7.16

#2

Build your own MySQL Docker image by extending mysql:5.7.16 and applying the modes you want.


#3

I solved it by doing this:

  - image: mysql:5.7.16
    environment:
      MYSQL_DATABASE: testdb
      MYSQL_ROOT_PASSWORD: root
    command:
      mysqld --sql-mode=IGNORE_SPACE,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION

#4

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.