Skip to content

brand new installation not connecting to database #194

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
l0rddarkf0rce opened this issue Jan 24, 2025 · 0 comments
Open

brand new installation not connecting to database #194

l0rddarkf0rce opened this issue Jan 24, 2025 · 0 comments

Comments

@l0rddarkf0rce
Copy link

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant