Uploaded image for project: 'XWiki Docker images'
  1. XWiki Docker images
  2. XDOCKER-10

Cannot change database name

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Minor
    • None

    Description

      When deploying manually (not using Docker compose) the docker image Mysql, setting the DB name to something OTHER than xwiki provokes a
      "com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Access denied for user 'xwiki'@'%' to database 'xwiki'"

      The problem seems to be related to hibernate file
      <property name="connection.url">jdbc:mysql://db/${MYSQL_DATABASE:-xwiki}?useSSL=false</property>
      The MYSQL_DATABASE environment variable doesn't seem to be taken into account, for a reason unknown to me. The JDBC driver should connect to xwikidb in my case but tries xwiki instead.

      Command passed to reproduce.

      docker run --name mysql-xwiki -v /share/gluster/mysql-xwiki:/var/lib/mysql -e MYSQL_ROOT_PASSWORD=somerootpw -e MYSQL_USER=xwiki -e MYSQL_PASSWORD=xwikipwd -e MYSQL_DATABASE=xwikidb -d mysql:5.7 --character-set-server=utf8 --collation-server=utf8_bin --explicit-defaults-for-timestamp=1

      docker run -d --name xwiki -p 8080:8080 -v /share/gluster/xwiki:/usr/local/xwiki -e MYSQL_USER=xwiki -e MYSQL_PASSWORD=xwikipwd -e MYSQL_DATABASE=xwikidb --link mysql-xwiki:db xwiki:mysql-tomcat

      Attachments

        Activity

          People

            zwindler Denis GERMAIN
            zwindler Denis GERMAIN
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: