Database name environment variable issue

Hi!

I got this from the stack trace when trying to setup xwiki on docker:

com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Access denied for user ‘xwiki_pow_user’@’%’ to database ‘xwiki’

But I started the container with this line (copy/pasted from bash, no typo)

-e DB_DATABASE=xwiki_pow \

So it seems that the _pow was removed from the DB name which would be strange. No I am guessing that DB_DATABASE is the wrong environment variable name so it just defaulted to xwiki?

What would be the correct name?

Edit: Peculiar. I decided to use the default xwiki as db name for now, so I changed the name in the db. But then I ran the same docker command, I forgot to remove the _pow. Strangely, the error I got was this: Access denied for user ‘xwiki_pow_user’@’%’ to database ‘xwiki_pow’
So suddenly it WAS able to get the db name from the environment variable (but then it didn’t exist any more)… I suspect some confusion in the code… :wink:

This line is definitely missing stuff :wink: Could you paste the whole docker run command you’re executing for both the DB image and the tomcat/xwiki image? I’d like to try reproducing your problem.

Thanks

Yea i meant that line was part of it… :slight_smile:
Here’s the entire startup that I used, it’s on swarm:

docker service create --replicas 1 --name xwiki_pow
–network pow
–constraint ‘node.hostname==crimson’
–mount source=xwiki_pow_data,target=/usr/local/xwiki
-e DB_HOST=mysql.local
-e DB_DATABASE=xwiki_pow
-e DB_USER=xwiki_pow_user
-e DB_PASSWORD=mypassword
-p 812:8080
xwiki:lts-mysql-tomcat

Edit: I see that this editor removed the trailing backspaces that connects the line to the next, so you’ll need to add those :slight_smile:

Ok, that’s the xwiki/servlet container image. What command line did you use for the db image?