Skip to content
This repository was archived by the owner on Aug 1, 2024. It is now read-only.

fix: Only create users in mysql 8.0 if they don't already exist#1112

Merged
timmc-edx merged 3 commits intomasterfrom
timmc/mysql-80-create-user-if-exists
Jun 28, 2023
Merged

fix: Only create users in mysql 8.0 if they don't already exist#1112
timmc-edx merged 3 commits intomasterfrom
timmc/mysql-80-create-user-if-exists

Conversation

@timmc-edx
Copy link
Copy Markdown
Contributor

@timmc-edx timmc-edx commented Jun 28, 2023

This issue was breaking provisioning early in the process.

The volumes for mysql57 and mysql80 may still contain users from previous provisioning runs. The old provisioning script for mysql 5.7 (provision.sql) uses implicit user creation via the GRANT statement, which is no longer supported in mysql 8.0. Therefore, the CREATE USER statements in provision-mysql80.sql fail. The fix here is to change to CREATE USER IF NOT EXISTS.

I've also deleted drop-mysql-user.sql. I suspect it was only used during testing to enable repeated tests of provisioning, but it's not referenced anywhere in the PR that adds it (#1097).


I've completed each of the following or determined they are not applicable:

  • Made a plan to communicate any major developer interface changes (or N/A)

This issue was breaking provisioning early in the process.

The images for mysql57 and mysql80 start off with users already present for
some reason. The old provisioning script for mysql 5.7 (provision.sql)
uses implicit user creation via the `GRANT` statement, which is no longer
supported in mysql 8.0. Therefore, the `CREATE USER` statements in
provision-mysql80.sql fail. The fix here is to change to `CREATE USER IF
NOT EXISTS`.

I've also deleted `drop-mysql-user.sql`. I suspect it was only used during
testing to enable repeated tests of provisioning, but it's not referenced
anywhere in the PR that adds it (#1097).
@timmc-edx timmc-edx merged commit 6b982d9 into master Jun 28, 2023
@timmc-edx timmc-edx deleted the timmc/mysql-80-create-user-if-exists branch June 28, 2023 19:51
nsprenkle pushed a commit that referenced this pull request Nov 21, 2023
This issue was breaking provisioning early in the process.

The volumes for mysql57 and mysql80 may still contain users from previous
provisioning runs. The old provisioning script for mysql 5.7 (provision.sql)
uses implicit user creation via the `GRANT` statement, which is no longer
supported in mysql 8.0. Therefore, the `CREATE USER` statements in
provision-mysql80.sql fail. The fix here is to change to `CREATE USER IF
NOT EXISTS`.

I've also deleted `drop-mysql-user.sql`. I suspect it was only used during
testing to enable repeated tests of provisioning, but it's not referenced
anywhere in the PR that adds it (#1097).
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants