SQLSTATE [HY000] [1045] Access Denied . . . #4805

Closed
opened 2026-02-05 09:17:19 +03:00 by OVERLORD · 7 comments
Owner

Originally created by @Charles349 on GitHub (Jun 2, 2024).

Attempted Debugging

  • I have read the debugging page

Searched GitHub Issues

  • I have searched GitHub for the issue.

Describe the Scenario

I complete the php artisan migrate step in the setup (following along to this video) https://youtu.be/_v-4BhVz7OI?si=LfSJo6uEtY-9v-qi

and get the following error.
bookstack

I've lost track of how many video and KB articles I've read through trying to understand the remedy. Help

Exact BookStack Version

v24.05.1

Log Content

No response

Hosting Environment

PHP Version 8.2.12
using xampp v3.3.0
Apache
MySQL

Originally created by @Charles349 on GitHub (Jun 2, 2024). ### Attempted Debugging - [X] I have read the debugging page ### Searched GitHub Issues - [X] I have searched GitHub for the issue. ### Describe the Scenario I complete the php artisan migrate step in the setup (following along to this video) https://youtu.be/_v-4BhVz7OI?si=LfSJo6uEtY-9v-qi and get the following error. ![bookstack](https://github.com/BookStackApp/BookStack/assets/171457052/3a65d70d-5caa-4bc3-adb9-ad660fa79a20) I've lost track of how many video and KB articles I've read through trying to understand the remedy. Help ### Exact BookStack Version v24.05.1 ### Log Content _No response_ ### Hosting Environment PHP Version 8.2.12 using xampp v3.3.0 Apache MySQL
OVERLORD added the 🐕 Support label 2026-02-05 09:17:19 +03:00
Author
Owner

@david-prv commented on GitHub (Jun 2, 2024):

Hi @Charles349,

can you verify that the database credentials you have entered in your .env file are not the default examples and that they are correct? You can use mysql -u your_username -p for that purpose and check if you can log in successfully.

KR

@david-prv commented on GitHub (Jun 2, 2024): Hi @Charles349, can you verify that the database credentials you have entered in your `.env` file are not the default examples and that they are correct? You can use `mysql -u your_username -p` for that purpose and check if you can log in successfully. KR
Author
Owner

@ssddanbrown commented on GitHub (Nov 28, 2024):

Since there's been no further follow-up I'll go ahead and close this off.

@ssddanbrown commented on GitHub (Nov 28, 2024): Since there's been no further follow-up I'll go ahead and close this off.
Author
Owner

@cevinov commented on GitHub (Mar 22, 2025):

Hello,

Could you guide me on how to provision bookstack container? Because right now I am getting this error:
SQLSTATE[HY000] [1045] Access denied for user 'database_username'@'bookstack.bookstack_default'

How can this problem be solved?

Thanks.

@cevinov commented on GitHub (Mar 22, 2025): Hello, Could you guide me on how to provision bookstack container? Because right now I am getting this error: SQLSTATE[HY000] [1045] Access denied for user 'database_username'@'bookstack.bookstack_default' How can this problem be solved? Thanks.
Author
Owner

@cevinov commented on GitHub (Mar 22, 2025):

This is my docker compose:

version: "2"
services:
bookstack:
image: lscr.io/linuxserver/bookstack
container_name: bookstack
environment:
- PUID=1000
- PGID=1000
- TZ=Asia/Jakarta
- APP_URL=http://localhost:6875
- APP_KEY=base64:yhvSgLkDaVgdMAN5464143zp54WCHXwAoTsfF99hUpE=
- DB_HOST=bookstack_db
- DB_USER=bookstack
- DB_PASSWORD=pass
- DB_DATABASE=bookstackapp
volumes:
- /bookstack/app:/config
ports:
- 6875:80
restart: unless-stopped
depends_on:
- bookstack_db
bookstack_db:
image: lscr.io/linuxserver/mariadb
container_name: bookstack_db
environment:
- PUID=1000
- PGID=1000
- MYSQL_ROOT_PASSWORD=pass
- TZ=Asia/Jakarta
- MYSQL_DATABASE=bookstackapp
- MYSQL_USER=bookstack
- MYSQL_PASSWORD=pass
volumes:
- /bookstack/db:/config
restart: unless-stopped

@cevinov commented on GitHub (Mar 22, 2025): This is my docker compose: --- version: "2" services: bookstack: image: lscr.io/linuxserver/bookstack container_name: bookstack environment: - PUID=1000 - PGID=1000 - TZ=Asia/Jakarta - APP_URL=http://localhost:6875 - APP_KEY=base64:yhvSgLkDaVgdMAN5464143zp54WCHXwAoTsfF99hUpE= - DB_HOST=bookstack_db - DB_USER=bookstack - DB_PASSWORD=pass - DB_DATABASE=bookstackapp volumes: - /bookstack/app:/config ports: - 6875:80 restart: unless-stopped depends_on: - bookstack_db bookstack_db: image: lscr.io/linuxserver/mariadb container_name: bookstack_db environment: - PUID=1000 - PGID=1000 - MYSQL_ROOT_PASSWORD=pass - TZ=Asia/Jakarta - MYSQL_DATABASE=bookstackapp - MYSQL_USER=bookstack - MYSQL_PASSWORD=pass volumes: - /bookstack/db:/config restart: unless-stopped
Author
Owner

@cevinov commented on GitHub (Mar 22, 2025):

Error:

Waiting for DB to be available

Illuminate\Database\QueryException

SQLSTATE[HY000] [1045] Access denied for user 'database_username'@'bookstack.bookstack_default' (using password: YES) (Connection: mysql, SQL: select exists (select 1 from information_schema.tables where table_schema = 'bookstackapp' 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()

[custom-init] No custom files found, skipping...

[ls.io-init] done.

@cevinov commented on GitHub (Mar 22, 2025): Error: Waiting for DB to be available Illuminate\Database\QueryException SQLSTATE[HY000] [1045] Access denied for user 'database_username'@'bookstack.bookstack_default' (using password: YES) (Connection: mysql, SQL: select exists (select 1 from information_schema.tables where table_schema = 'bookstackapp' 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() [custom-init] No custom files found, skipping... [ls.io-init] done.
Author
Owner

@ssddanbrown commented on GitHub (Mar 22, 2025):

@cevinov You can find an up-to-date, complete and commented example of a compose stack here:
https://codeberg.org/bookstack/devops/src/branch/main/config/lsio-docker/docker-compose.yml

@ssddanbrown commented on GitHub (Mar 22, 2025): @cevinov You can find an up-to-date, complete and commented example of a compose stack here: https://codeberg.org/bookstack/devops/src/branch/main/config/lsio-docker/docker-compose.yml
Author
Owner

@cevinov commented on GitHub (Jun 19, 2025):

Already solved thanks, using another mariaDB version

@cevinov commented on GitHub (Jun 19, 2025): Already solved thanks, using another mariaDB version
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#4805