SQLSTATE[HY000] [1045] Access denied for user 'database_username'@'Bockstack.Bookstack' #5240

Closed
opened 2026-02-05 09:50:50 +03:00 by OVERLORD · 3 comments
Owner

Originally created by @DevJulian98 on GitHub (Mar 29, 2025).

Attempted Debugging

  • I have read the debugging page

Searched GitHub Issues

  • I have searched GitHub for the issue.

Describe the Scenario

i installed bookstack with portainer with a yaml file and always after startup this error came up
in the container i can also see that the db can not be connected but i have not found any solution in the internet for that

Image Image

Exact BookStack Version

latest

Log Content

Illuminate\Database\QueryException

SQLSTATE[HY000] [1045] Access denied for user 'database_username'@'Bockstack.Bookstack' (using password: YES) (Connection: mysql, SQL: select exists (select 1 from information_schema.tables where table_schema = 'bookstack' and table_name = 'migrations' and table_type in ('BASE TABLE', 'SYSTEM VERSIONED')) as exists)

at /app/www/vendor/laravel/framework/src/Illuminate/Database/Connection.php:825

821▕                     $this->getName(), $query, $this->prepareBindings($bindings), $e

822▕                 );

823▕             }

824▕ 

➜ 825▕ throw new QueryException(

826▕                 $this->getName(), $query, $this->prepareBindings($bindings), $e

827▕             );

828▕         }

829▕     }

  +38 vendor frames 

39 /app/www/artisan:35
Illuminate\Foundation\Console\Kernel::handle()

Hosting Environment

Portainer Community Edition 2.27.3 LTS on a Raspi 5 with Raspi OS light 64 bit Version

Originally created by @DevJulian98 on GitHub (Mar 29, 2025). ### Attempted Debugging - [x] I have read the debugging page ### Searched GitHub Issues - [x] I have searched GitHub for the issue. ### Describe the Scenario i installed bookstack with portainer with a yaml file and always after startup this error came up in the container i can also see that the db can not be connected but i have not found any solution in the internet for that <img width="808" alt="Image" src="https://github.com/user-attachments/assets/31dd1da8-c59d-48f1-a56c-dd0a72534a65" /> <img width="466" alt="Image" src="https://github.com/user-attachments/assets/80a9568d-d557-4b08-b177-073b4b71ca75" /> ### Exact BookStack Version latest ### Log Content Illuminate\Database\QueryException SQLSTATE[HY000] [1045] Access denied for user 'database_username'@'Bockstack.Bookstack' (using password: YES) (Connection: mysql, SQL: select exists (select 1 from information_schema.tables where table_schema = 'bookstack' and table_name = 'migrations' and table_type in ('BASE TABLE', 'SYSTEM VERSIONED')) as `exists`) at /app/www/vendor/laravel/framework/src/Illuminate/Database/Connection.php:825 821▕ $this->getName(), $query, $this->prepareBindings($bindings), $e 822▕ ); 823▕ } 824▕ ➜ 825▕ throw new QueryException( 826▕ $this->getName(), $query, $this->prepareBindings($bindings), $e 827▕ ); 828▕ } 829▕ } +38 vendor frames 39 /app/www/artisan:35 Illuminate\Foundation\Console\Kernel::handle() ### Hosting Environment Portainer Community Edition 2.27.3 LTS on a Raspi 5 with Raspi OS light 64 bit Version
OVERLORD added the 🐕 Support label 2026-02-05 09:50:50 +03:00
Author
Owner

@V0idH4nter commented on GitHub (Apr 9, 2025):

      - PUID=1000
      - PGID=1000
      - APP_URL=http://localhost:6875
      - APP_KEY=base64:Kmz+6X+qY3RmsI9XtA0Z4v8V3PZb9K3dkcJ2h4ZV23c=
      - DB_HOST=bookstack_db
      - DB_PORT=3306
      - DB_USER=bookstack
      - DB_PASS=pw
      - DB_DATABASE=bookstackapp

Replace DB_PASS=pw with DB_PASSWORD

Hope this helps!

@V0idH4nter commented on GitHub (Apr 9, 2025): ``` - PUID=1000 - PGID=1000 - APP_URL=http://localhost:6875 - APP_KEY=base64:Kmz+6X+qY3RmsI9XtA0Z4v8V3PZb9K3dkcJ2h4ZV23c= - DB_HOST=bookstack_db - DB_PORT=3306 - DB_USER=bookstack - DB_PASS=pw - DB_DATABASE=bookstackapp ``` Replace DB_PASS=pw with DB_PASSWORD Hope this helps!
Author
Owner

@ssddanbrown commented on GitHub (Apr 9, 2025):

Thanks @V0idH4nter,

Upon that, the DB_USER should be DB_USERNAME.

Here's a fairly complete compose stack as an example:
https://codeberg.org/bookstack/devops/src/branch/main/config/lsio-docker/docker-compose.yml

@ssddanbrown commented on GitHub (Apr 9, 2025): Thanks @V0idH4nter, Upon that, the `DB_USER` should be `DB_USERNAME`. Here's a fairly complete compose stack as an example: https://codeberg.org/bookstack/devops/src/branch/main/config/lsio-docker/docker-compose.yml
Author
Owner

@ssddanbrown commented on GitHub (Sep 3, 2025):

Since there's been no further follow-up I'm going to close this off.

@ssddanbrown commented on GitHub (Sep 3, 2025): Since there's been no further follow-up I'm going to close this off.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#5240