Issues with Bookstack and remote MySQL database

First thing first, when creating this thread there is no Bookstack option available in the list of topics/containers. I had no choice to select booksonic. If its possible to move this thread, please feel free.

When creating the bookstack container using either cli or compose I am always seeing errors like the following:

Doctrine\DBAL\Driver\PDOException::(“SQLSTATE[HY000] [1045] Access denied for user ‘bookstack_admin’@‘’ (using password: YES)”)

That is the host machine IP address. I tried configuring an .env file but it doesnt make any difference. The settings I configure for the database host, user, pass etc, as per the instructions on the lsio documentation for bookstack do not work.

Any help would be greatly appreciated!

you don’t have to tag threads, it’s optional.

can you share your compose and a pastebin of docker logs -f bookstack

if you know how to login to your mariadb as root, do so and provide the output of select user,host from mysql.user;

1 Like

you don’t have to tag threads, it’s optional.

It actually wouldnt let me submit without the tag, no worries though.

Log here

Docker compose:

version: "2"
image: linuxserver/bookstack
container_name: bookstack
  - PUID=1000
  - PGID=1000
  - DB_HOST=
  - DB_USER=bookstack_admin
  - DB_PASS=redacted
  - DB_DATABASE=bookstack
  - /home/username/Docker/Config/Bookstack:/config
  - 6875:80
restart: unless-stopped

As for the mariadb users list, I use MySQL:
| user | host |
| bookstack_admin | % |
| hass_admin | % |
| kodi_admin | % |
| nextcloud_admin | % |
| root | % |
| root | |
| root | LG-NAS |
| debian-sys-maint | localhost |

And, actually to add to this, I have tried starting this container with both compose and directly in the cli on two independent machines, same result.

you mentioned you’re using mysql as opposed to our mariadb container; did you verify your mysql instance is allowing remote connections? By default this isn’t allowed. it does make it a bit more challenging since we know the issue is on the database side but you’re not using our database, presumably because your mysql instance is on another server it looks like.

Have you tried just connecting? mysql -u bookstack_admin -p -h input your password and show databases; (you should see bookstack)

1 Like

Yea… there seems to be an issue with the mysql client. I’m getting this when connecting from a remote host:

mysql -u bookstack_admin -p bookstack -h -P 3306           
Enter password: 
ERROR 1045 (28000): Access denied for user 'bookstack_admin'@'' (using password: 

Alrighty. I’ll have to figure out what’s happening. I appreciate the help so much. Thank you!!

couple things you can check… in your my.cnf or mysqld.cnf or whatever config file you have (it can vary)

  1. look for bind-address, by default it’s bind-address meaning connections are only allowed from itself (ie, useless) so you can comment this line out or change to bind-address and then restart mysql service

  2. verify your firewall, iptables, ufw, nfw, firewalld isn’t blocking port 3306

  3. sometimes there is a skip-networking line in the cnf file, comment that out and then restart mysql service

1 Like

I checked all of those you listed and they were all configured per your instructions.

I ended up just dropping the user/db and added them back and its working now. Thanks a lot!!

glad you got it sorted, pretty weird issue!