Skip to content

Small fix DB Login error with special characters#3022

Closed
Erdack54 wants to merge 2 commits intoBookStackApp:masterfrom
Erdack54:master
Closed

Small fix DB Login error with special characters#3022
Erdack54 wants to merge 2 commits intoBookStackApp:masterfrom
Erdack54:master

Conversation

@Erdack54
Copy link

Hi, small fix for DB Login error (SQLSTATE[HY000] [1045] Access denied for user 'database_username'@'database_database' ...) with special characters on credentials, especialy on DB_PASSWORD

Working idk if it's perfect but the idea is here, i and many peoples apparently have encounter this small problem, especialy with Docker image like linuxserver/bookstack work on first start no problem everything working very well but after a restart MySQL Access denied for use.. with a nice HTTP Error 500 on browser 😕

First pull request hope it's not too bad and will help :D

Fix db login error (SQLSTATE[HY000] [1045] Access denied for user 'database_username'@'database_database' ...) with special characters on credentials
@ssddanbrown
Copy link
Member

Thanks for offering this @Erdack54 but we do already have a warning in regards to potential required quoting here:

# NOTE: If any of your values contain a space or a hash you will need to
# wrap the entire value in quotes. (eg. MAIL_FROM_NAME="BookStack Mailer")

Otherwise I try to keep these config files, especially the default example, fairly concise. I don't think the MySQL/MariaDB note has much value being in the .env.example file itself since that would be experienced while creating a user on the database side, rather then during the BookStack connection to the database.

In addition, I don't think these changes would help solve that linuxserver.io issue where it fails to start after a restart. In fact, we'd need to coordinate any changes to the default .env.example values otherwise I think we'll be breaking their script, from a quick look at their process. Might potentially break things for other container/hosting providers.

There could be some value in pre-quoting some values, like the DB_PASSWORD, if this becomes common but otherwise hopefully the top warning in the .env.example should suffice. If that warning is misguided or incorrect in any way feel free to let me know and it can be updated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants