Skip to content

brand new installation not connecting to database #194

@l0rddarkf0rce

Description

@l0rddarkf0rce

The installation process seems to go smoothly until it is time for first run after I run php artisan koel:init --no-assets, I get WARN Cannot connect to the database. Let's set it up. I try to enter the requested information to no avail. When I look at the DB logs I see the following message.

2025-01-24 16:09:32 3 [Warning] Aborted connection 3 to db: 'unconnected' user: 'unauthenticated' host: '172.21.0.3' (This connection closed normally without authentication)

The IP shown is the correct IP for the koel container, so they can see each other. So I am not sure what the problem is at this point. Here is how I create the 2 containers and network.

docker network create --attachable koel-net

docker run -d \
   --name koel-db \
   -e MYSQL_ROOT_PASSWORD='koel' \
   -e MYSQL_DATABASE='koel' \
   -e MYSQL_USER='koel' \
   -e MYSQL_PASSWORD='koel' \
   --restart unless-stopped \
   --network=koel-net \
   -v /data/koel/koel_db:/var/lib/mysql \
   mariadb:10.11

docker run -d \
   --name koel \
   -p 80:80 \
   -e DB_CONNECTION=mysql \
   -e DB_HOST='koel-db' \
   -e DB_DATABASE='koel' \
   -e DB_USERNAME='koel' \
   -e DB_PASSWORD='koel' \
   --network=koel-net \
   -v /share/Music:/music \
   -v /data/koel/covers:/var/www/html/public/img/covers \
   -v /data/koel/search_index:/var/www/html/storage/search-indexes \
   --restart unless-stopped \
   phanan/koel

Right after that I type docker exec --user www-data -it koel bash to go into the container and run the php artisan koel:init --no-assets command to initialize and create the APP_KEY.

If I try to connect to the GUI interface on koel I see the following error message...

SQLSTATE[HY000] [1130] Host '172.21.0.3' is not allowed to connect to this MariaDB server (Connection: mysql, SQL: select * from `licenses` order by `created_at` desc limit 1)

Thanks in advance for any help!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions