Connection problem between my client and my database on docker compose install #2897

Closed
opened 2026-02-05 05:39:32 +03:00 by OVERLORD · 5 comments
Owner

Originally created by @Azrod31 on GitHub (Jul 9, 2022).

Attempted Debugging

  • I have read the debugging page

Searched GitHub Issues

  • I have searched GitHub for the issue.

Describe the Scenario

Hello,

My problem is that my client can't connect to the database. I see from the logs that the wrong user is selected. Is it possible to change this in a config file?

Here is the error in question :
image

In addition, I manage to connect to the database and execute the command that is indicated, but even after having executed it, it does not change anything.

Thanks for help.

Exact BookStack Version

v22.06.2-ls24

Log Content

No response

PHP Version

No response

Hosting Environment

Debian 11 - up to date
Kernel : 5.10.0-14

Originally created by @Azrod31 on GitHub (Jul 9, 2022). ### Attempted Debugging - [X] I have read the debugging page ### Searched GitHub Issues - [X] I have searched GitHub for the issue. ### Describe the Scenario Hello, My problem is that my client can't connect to the database. I see from the logs that the wrong user is selected. Is it possible to change this in a config file? Here is the error in question : ![image](https://user-images.githubusercontent.com/95468641/178075116-073fa570-2e5a-49bc-a888-3f660126e50e.png) In addition, I manage to connect to the database and execute the command that is indicated, but even after having executed it, it does not change anything. Thanks for help. ### Exact BookStack Version v22.06.2-ls24 ### Log Content _No response_ ### PHP Version _No response_ ### Hosting Environment Debian 11 - up to date Kernel : 5.10.0-14
OVERLORD added the 🐕 Support label 2026-02-05 05:39:32 +03:00
Author
Owner

@ssddanbrown commented on GitHub (Jul 9, 2022):

Hi @Azrod31,

In addition, I manage to connect to the database and execute the command that is indicated, but even after having executed it, it does not change anything.

The shown command, in the error message, reflects the command BookStack is attempting to use, not the command which would fix the issue.

I see from the logs that the wrong user is selected. Is it possible to change this in a config file?

Yes, but how you do that depends on how you're running BookStack. Based on your provided version it looks like you are using the linuxserver.io docker image. How are you running the container and are you passing environment options? The linuxserver docker image usage instructions provide details on database credentials: https://github.com/linuxserver/docker-bookstack/#usage

@ssddanbrown commented on GitHub (Jul 9, 2022): Hi @Azrod31, > In addition, I manage to connect to the database and execute the command that is indicated, but even after having executed it, it does not change anything. The shown command, in the error message, reflects the command BookStack is attempting to use, not the command which would fix the issue. > I see from the logs that the wrong user is selected. Is it possible to change this in a config file? Yes, but how you do that depends on how you're running BookStack. Based on your provided version it looks like you are using the linuxserver.io docker image. How are you running the container and are you passing environment options? The linuxserver docker image usage instructions provide details on database credentials: https://github.com/linuxserver/docker-bookstack/#usage
Author
Owner

@Azrod31 commented on GitHub (Jul 9, 2022):

Hi @ssddanbrown,

Thanks for you reply. Yes I'm use the linuxserver.io docker image.

Here is my docker-compose.yml :

image

I have change the DB_USER and DB_PASS to DB_USERNAME and DB_PASSWORD because I found in this issue that it could cause problems. https://github.com/linuxserver/docker-bookstack/issues/58

Yes, I have pass environment options, and I think it's right because my user is debian and I put PUID: 1000 and GUID: 1000 :
image

You thinks the problem it's the incorrect PUID and GUID ?

@Azrod31 commented on GitHub (Jul 9, 2022): Hi @ssddanbrown, Thanks for you reply. Yes I'm use the linuxserver.io docker image. Here is my docker-compose.yml : ![image](https://user-images.githubusercontent.com/95468641/178099735-2ae892db-ebc1-4465-a208-7a494ba078b7.png) I have change the DB_USER and DB_PASS to DB_USERNAME and DB_PASSWORD because I found in this issue that it could cause problems. https://github.com/linuxserver/docker-bookstack/issues/58 Yes, I have pass environment options, and I think it's right because my user is debian and I put PUID: 1000 and GUID: 1000 : ![image](https://user-images.githubusercontent.com/95468641/178099819-5bd4437c-ea5b-4c42-a996-461ea2d901f1.png) You thinks the problem it's the incorrect PUID and GUID ?
Author
Owner

@ssddanbrown commented on GitHub (Jul 9, 2022):

You thinks the problem it's the incorrect PUID and GUID ?

Nothing shown is making me think that those are the issue here.

One thing I noticed it that you have mounted volumes, for both the BookStack and Database containers, at the same path. This is quite dangerous in my opinion. May not be causing your specific issue though.

Have you ran any additional commands on the MySQL system? Anything to harden or add security to the database? The error shown does not really reflect the wrong user being used but reflects an unexpected host value, maybe for the system as a whole or for the bookstack user.

@ssddanbrown commented on GitHub (Jul 9, 2022): > You thinks the problem it's the incorrect PUID and GUID ? Nothing shown is making me think that those are the issue here. One thing I noticed it that you have mounted volumes, for both the BookStack and Database containers, at the same path. This is quite dangerous in my opinion. May not be causing your specific issue though. Have you ran any additional commands on the MySQL system? Anything to harden or add security to the database? The error shown does not really reflect the wrong user being used but reflects an unexpected host value, maybe for the system as a whole or for the bookstack user.
Author
Owner

@Azrod31 commented on GitHub (Jul 9, 2022):

Ok thanks, I found my mistake. It is indeed a volume problem which are mounted on the same path. I changed the base volume path by adding /db and it works.

image

Thanks @ssddanbrown

@Azrod31 commented on GitHub (Jul 9, 2022): Ok thanks, I found my mistake. It is indeed a volume problem which are mounted on the same path. I changed the base volume path by adding `/db` and it works. ![image](https://user-images.githubusercontent.com/95468641/178100881-28605a77-cf93-46c4-8b41-d70fc21867e1.png) Thanks @ssddanbrown
Author
Owner

@ssddanbrown commented on GitHub (Jul 9, 2022):

Alright, Will therefore close this off. Just remember to keep the /path/to/data files safe.
That's only really there as an example, since that's an uncommon path. Usually I'd use something like ./db:/config for the database container and ./bookstack:/config for the bookstack container, to store the data within the same folder as the docker-compose.yml file.

@ssddanbrown commented on GitHub (Jul 9, 2022): Alright, Will therefore close this off. Just remember to keep the `/path/to/data` files safe. That's only really there as an example, since that's an uncommon path. Usually I'd use something like `./db:/config` for the database container and `./bookstack:/config` for the bookstack container, to store the data within the same folder as the `docker-compose.yml` file.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#2897