Skip to content

chore: bump MySQL to min 8.4 and support 9.7#61247

Merged
susnux merged 2 commits into
masterfrom
fix/mysql
Jun 22, 2026
Merged

chore: bump MySQL to min 8.4 and support 9.7#61247
susnux merged 2 commits into
masterfrom
fix/mysql

Conversation

@susnux

@susnux susnux commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Version 8.0 is out-of-support.
  • Version 8.4 is now the oldest LTS.
  • New LTS is 9.7

documentation: nextcloud/documentation#15200

Checklist

AI (if applicable)

  • The content of this PR was partly or fully generated using AI

@susnux susnux added this to the Nextcloud 35 milestone Jun 12, 2026
@susnux susnux requested a review from a team as a code owner June 12, 2026 13:34
@susnux susnux added 2. developing Work in progress feature: database Database related DB pending documentation This pull request needs an associated documentation update labels Jun 12, 2026

mysql:
image: ghcr.io/nextcloud/continuous-integration-mysql-${{ matrix.mysql-versions }}:latest # zizmor: ignore[unpinned-images]
image: mysql:${{ matrix.mysql-versions }} # zizmor: ignore[unpinned-images]

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nickvergessen as we now have a docker cache in place we do not run into problems with docker hub anymore. Do we still need to use our own images?
If yes I will prepare the new image.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it more likely that we get hacked or mysql? :P
I guess both is fine

@susnux susnux added 3. to review Waiting for reviews and removed 2. developing Work in progress labels Jun 12, 2026
@susnux susnux force-pushed the fix/mysql branch 5 times, most recently from c06876a to 26e389f Compare June 21, 2026 09:06
susnux added 2 commits June 21, 2026 22:25
- Version 8.0 is out-of-support.
- Version 8.4 is now the oldest LTS.
- New LTS is 9.7

Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
@susnux susnux added 4. to release Ready to be released and/or waiting for tests to finish and removed 3. to review Waiting for reviews labels Jun 21, 2026
@susnux susnux removed the pending documentation This pull request needs an associated documentation update label Jun 22, 2026
@susnux susnux merged commit ecbb5d8 into master Jun 22, 2026
231 checks passed
@susnux susnux deleted the fix/mysql branch June 22, 2026 09:10
echo "SET GLOBAL sql_mode=(SELECT CONCAT(@@sql_mode,',ONLY_FULL_GROUP_BY'));" | mysql -h 127.0.0.1 -P 4444 -u root -prootpassword
echo "SELECT @@sql_mode;" | mysql -h 127.0.0.1 -P 4444 -u root -prootpassword

- name: Enable MD5 MySQL support

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PS: Is this only needed in sharding? Or should it also be in phpunit-mysql?
And I guess we should change https://github.com/nextcloud/.github/blob/master/workflow-templates/phpunit-mysql.yml as well so apps start testing against it

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only needed in sharding, for non sharded setup the installer will handle this.
But for sharded setup it needs to be done manually per shard.

For apps they should setup a fresh server, no? Because then the installer takes care of this.

Comment on lines +41 to +61
// for MD5 support
// In MySQL 9+ MD5 has been deprecated and is only available as a component.
// Until we dropped the support for it on the function builder, we need to load the component.
if ($connection->getDatabasePlatform() instanceof MySQL84Platform) {
$statement = $connection->prepare("SHOW VARIABLES LIKE 'version';");
$result = $statement->executeQuery();
$row = $result->fetchAssociative();
$version = $row['Value'];
[$major, ] = explode('.', strtolower($version));
if ((int)$major >= 9) {
// check if the component is already loaded, if not load it
$statement = $connection->prepare("SELECT COUNT(*) FROM mysql.component WHERE component_urn = 'file://component_classic_hashing';");
$result = $statement->executeQuery();
$count = $result->fetchOne();
if ($count !== false && (int)$count === 0) {
// not yet loaded
$statement = $connection->prepare("INSTALL COMPONENT 'file://component_classic_hashing';");
$statement->executeStatement();
}
}
}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AH, seems I missed that

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

Labels

4. to release Ready to be released and/or waiting for tests to finish feature: database Database related DB

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants