From d4ea836125c71a1f0080cc7920062e005420c895 Mon Sep 17 00:00:00 2001 From: Julian Brost Date: Wed, 20 Aug 2025 14:03:16 +0200 Subject: [PATCH] Fix compatibility with MySQL 8.0.0 to 8.0.13 SESSION_VARIABLES_ADMIN wasn't actually introduced in MySQL 8.0.0 but only in 8.0.14.[^1] Use exactly that version in the version comparison to ensure compatibility. [^1]: https://dev.mysql.com/doc/refman/8.0/en/privileges-provided.html#priv_session-variables-admin --- internal/services/mysql/root_connection.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/services/mysql/root_connection.go b/internal/services/mysql/root_connection.go index 9a038fb..28d50c1 100644 --- a/internal/services/mysql/root_connection.go +++ b/internal/services/mysql/root_connection.go @@ -52,8 +52,8 @@ func (m *rootConnection) CreateMysqlDatabase() services.MysqlDatabaseBase { if err != nil { panic(err) } - // SESSION_VARIABLES_ADMIN is only needed and supported on MySQL 8+, that magic comments only executes it there. - _, err = m.db.Exec(fmt.Sprintf("/*!80000 GRANT SESSION_VARIABLES_ADMIN ON *.* TO %s */", username)) + // SESSION_VARIABLES_ADMIN is only needed and supported on MySQL 8.0.14+, that magic comments only executes it there. + _, err = m.db.Exec(fmt.Sprintf("/*!80014 GRANT SESSION_VARIABLES_ADMIN ON *.* TO %s */", username)) if err != nil { panic(err) }