BookStack icon indicating copy to clipboard operation
BookStack copied to clipboard

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

Open DevJulian98 opened this issue 8 months ago • 2 comments

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

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

DevJulian98 avatar Mar 28 '25 21:03 DevJulian98

      - 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 avatar Apr 09 '25 08:04 V0idH4nter

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 avatar Apr 09 '25 11:04 ssddanbrown

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

ssddanbrown avatar Sep 03 '25 12:09 ssddanbrown