Because of this, the evaluated SQL looks like this:
SET PASSWORD FOR 'readonly'@'localhost' = "11e65882-ca47-4328-876e-50735457dd51";
# --> Error 1372: Password hash should be a 41-digit hexadecimal number
If we use the MySQL 5.7 compatible version instead, this runs successfully:
SET PASSWORD FOR 'readonly'@'localhost' = PASSWORD("11e65882-ca47-4328-876e-50735457dd51");
Steps to Reproduce
terraform apply
Important Factoids
Running a MariaDB 10.3.8 instance in Amazon RDS.
References
This was originally addressed in #18, until MariaDB changed behavior in 10.3.7.
It looks like another possible solution would be to take the approach used in mysql_user, and use ALTER USER … IDENTIFIED BY for versions above MySQL 5.7.6. (See hashicorp/terraform#8230.)
Terraform Version
Terraform v0.11.11
Affected Resource(s)
mysql_user_password
Terraform Configuration Files
Debug Output
Panic Output
N/A
Expected Behavior
The generated password for the
readonly
account should have been set without errors.Actual Behavior
It wasn't!
The provider checks against
@@GLOBAL.innodb_version
, which as of MariaDB 10.3.7+ returns the MariaDB version. This means that this check will return false, even though MariaDB is still only MySQL 5.7 compatible, and so needs thePASSWORD()
helper.Because of this, the evaluated SQL looks like this:
If we use the MySQL 5.7 compatible version instead, this runs successfully:
Steps to Reproduce
terraform apply
Important Factoids
Running a MariaDB 10.3.8 instance in Amazon RDS.
References
This was originally addressed in #18, until MariaDB changed behavior in 10.3.7.