Skip to content

Fix handling of mysql passwords with weird characters in it #2660

New issue

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

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

Already on GitHub? # to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

eldering
Copy link
Member

The password is passed inside the environment variable DATABASE_URL which is URI-like. However, it must be URL encoded there if it contains any strange characters, like a space, %, etc.

Also add a handy command dj_setup_database update-password that reset the MySQL database user password to what it currently in etc/dbpassword.secret, and handle weird passwords in this script. This script is now bash, and should probably be rewritten in PHP or so.

@eldering eldering force-pushed the fix-mysql-password branch 2 times, most recently from 169aa03 to ba630f7 Compare August 25, 2024 17:22
@eldering eldering force-pushed the fix-mysql-password branch from ba630f7 to 0dc1deb Compare August 25, 2024 17:41
@eldering eldering closed this Aug 25, 2024
@eldering eldering force-pushed the fix-mysql-password branch from 0dc1deb to 9f12b77 Compare August 25, 2024 19:04
@eldering eldering reopened this Aug 25, 2024
@eldering eldering force-pushed the fix-mysql-password branch 3 times, most recently from 0cb10aa to e371261 Compare August 25, 2024 19:45
@eldering eldering mentioned this pull request Nov 22, 2024
@eldering eldering force-pushed the fix-mysql-password branch 7 times, most recently from 281bcfa to 23b48a9 Compare November 24, 2024 15:04
@eldering eldering mentioned this pull request Nov 25, 2024
@eldering eldering force-pushed the fix-mysql-password branch 7 times, most recently from cb023c6 to 25b2a01 Compare November 27, 2024 00:08
See for reference:
- https://dev.mysql.com/doc/refman/8.0/en/connecting-using-uri-or-key-value-pairs.html#connecting-using-uri
- https://symfony.com/doc/current/doctrine.html
but note that we must use `rawurlencode` instead of `urlencode` which
differ in how they encode a space (as tested).

Fixes: #2651
Closes: #2502 as this is likely fixed but I couldn't reproduce it
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants