goryn-clade / pathfinder-containers

A Docker-compose solution for Pathfinder mapping tool using Traefik
Other
62 stars 66 forks source link

[BUG] Special characters in MYSQL_PASSWORD result in a not working database access #27

Open SteveTh3Piirate opened 3 years ago

SteveTh3Piirate commented 3 years ago

I've previously had a version of PF running on my Unraid Server, I've got this one sort of running but for some reason the database is denying access. Below is the quote I'm getting from withing the Setup Page.

SQLSTATE[HY000] [1045] Access denied for user 'root'@'172.25.0.5' (using password: YES)

I'm not sure what the problem is, i cannot even log in through terminal, gives me the same errors.

fleischsalatinspace commented 3 years ago

From slack:

there is or used to be a bug/strange behavior in the one of the entryscripts in the image. If you use any special characters in your MYSQL_PASSWORD, the sql connection fails

Can you provide technical details on:

i cannot even log in through terminal, gives me the same errors.

SteveTh3Piirate commented 3 years ago

I edited the docker-compose.yml

Instead of using image: bianjp/mariadb-alpine:latest

I used image: linuxserver/mariadb:latest

Instantly let me in and set up tables. Very Strange.

fleischsalatinspace commented 3 years ago

Can you please rename the issue to [BUG] Special characters in MYSQL_PASSWORD result in a not working database access. This will be worked on in combination with possible changes to the base images. thank you

samoneilll commented 3 years ago

I've tried to recreate this issue by slowly adding more special characters to the password till I ended up with MYSQL_PASSWORD="P4#@%^&*$-></?=_~", and it's still working using the brianjp/mariadb-alpine image, on macOS as the host.

I have a suspicion that it's not about the password of the image itself, but rather about the host machine and how the values are read from .env. If anybody has a combination of host OS and password that I could try to test with I'd appreciate it.

barndawgie commented 2 years ago

I encountered this problem on an AWS EC2 instance running their stock Ubuntu 20.04 image, so should be relatively easy to replicate.

rwc commented 2 years ago

@samoneilll I was able to reproduce with Debian 10 & Debian 11.

  1. The quotes are being interpreted as part of the password itself
  2. When connecting to the database locally, said password is refused. After adding command: --skip-grant-tables I was able to auth as root and grant privileges to 'root'@'localhost' & 'root'@'%' then afterwards successfully connect the app to the db.