Skip to content

Commit

Permalink
Merge pull request #1656 from seekingalpha/fix-mysql-null-password
Browse files Browse the repository at this point in the history
Fix regression when Mysql user password is not set
  • Loading branch information
domenkozar authored Jan 2, 2025
2 parents dd1740d + 23724ef commit 8d13e1f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/modules/services/mysql.nix
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ with lib; let
echo "Adding user: ${user.name}"
${optionalString (user.password != null) "password='${user.password}'"}
(
if [ "${user.name}" = "root" ] && [ -n ${user.password} ]; then
if [ "${user.name}" = "root" ] && [ -n "$password" ]; then
echo "ALTER USER 'root'@'localhost' IDENTIFIED BY '$password';"
else
echo "CREATE USER IF NOT EXISTS '${user.name}'@'localhost' ${optionalString (user.password != null) "IDENTIFIED BY '$password'"};"
Expand Down

0 comments on commit 8d13e1f

Please sign in to comment.