Details

    • Task
    • Status: Open (View Workflow)
    • Minor
    • Resolution: Unresolved
    • None
    • Docker
    • None

    Description

      Currently MYSQL_DATABASE only supports creating one database forcing a dirty CMD int hack to workaround

      I would like this to support CSV so you can create multiple databases with the same user.
      without having to mess around with CMD and init files.

      Attachments

        Activity

          danblack Daniel Black added a comment -

          I'm ok with this concept.

          Did you want to write a change to https://github.com/MariaDB/mariadb-docker/blob/master/docker-entrypoint.sh ?

          Keep the MYSQL_DATABASE/MARIADB_DATABASE as simple (non-array) variables and ensure that docker_exec_client just uses the first in the list.

          danblack Daniel Black added a comment - I'm ok with this concept. Did you want to write a change to https://github.com/MariaDB/mariadb-docker/blob/master/docker-entrypoint.sh ? Keep the MYSQL_DATABASE/MARIADB_DATABASE as simple (non-array) variables and ensure that docker_exec_client just uses the first in the list.
          danblack Daniel Black added a comment - - edited

          From https://github.com/MariaDB/mariadb-docker/pull/409#issuecomment-1030646420

          Mostly I'm like "why not" on this. The only problem I see is how we're going to deal with docker_exec_client: Users expect MYSQL_DATABASE and MARIADB_DATABASE to be a single database name, so we must add yet another env variable. I definitely wouldn't use CSV, but a simple space separated list.

          So considering the not so obvious implementation: Why not /docker-entrypoint-initdb.d? This is no more than creating a /docker-entrypoint-initdb.d/create-another_database.sql with

          CREATE DATABASE IF NOT EXISTS `another_database`;
          GRANT ALL ON `another_database`.* TO 'my_sql_user'@'%';
          

          Yes. for docker_exec_client we should trim this down to the first database of the CSV.

          Madpeter do you have an answer for why not docker-entrypoint-initdb.d?

          danblack Daniel Black added a comment - - edited From https://github.com/MariaDB/mariadb-docker/pull/409#issuecomment-1030646420 Mostly I'm like "why not" on this. The only problem I see is how we're going to deal with docker_exec_client: Users expect MYSQL_DATABASE and MARIADB_DATABASE to be a single database name, so we must add yet another env variable. I definitely wouldn't use CSV, but a simple space separated list. So considering the not so obvious implementation: Why not /docker-entrypoint-initdb.d? This is no more than creating a /docker-entrypoint-initdb.d/create-another_database.sql with CREATE DATABASE IF NOT EXISTS `another_database`; GRANT ALL ON `another_database`.* TO 'my_sql_user'@'%'; Yes. for docker_exec_client we should trim this down to the first database of the CSV. Madpeter do you have an answer for why not docker-entrypoint-initdb.d?

          People

            Unassigned Unassigned
            Madpeter Madpeter
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:

              Git Integration

                Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.