Skip to content

MariaDB now defaults to a root db user with a root password, but install scripts assume empty password #8

Description

@jazzsequence

WPUnit tests installed via WPUnit helpers will fail because the default db user requires a password now. A workaround I've implemented in Pantheon HUD is adding a step that changes the password back to empty:

      - name: Reset MariaDB root password to empty
        run: |
          until mysqladmin ping -h127.0.0.1 -uroot -proot --silent; do
            sleep 1
          done
          mysql -h127.0.0.1 -uroot -proot <<'SQL'
            ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '';
            FLUSH PRIVILEGES;
          SQL
          mysqladmin ping -h127.0.0.1 -uroot --silent

This is a fine band-aid, but ideally this should be handled in WPUnit Helpers. However, I don't like making an update that makes something less secure (even though, arguably, a known password vs an empty password is sort of sixes in terms of actual security for a database environment that's going to be torn down anyway), so I propose:

  • implementing the workaround into a new minor point release of the package
  • creating a major version release in which use_empty_db_password is a flag that can be toggled
  • additionally, allow db_root_pw to be a flag that can be set
  • set the default root db password to root
  • integrate those steps into the scripts to pull the db password from the passed parameters
  • create a major version bump for the behavior change

Activity

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

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingenhancementNew feature or request

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions