Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update MariaDB from 10.11 to 11.4 (LTS) #93

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

kdambekalns
Copy link
Member

This upgrades the used MariaDB from version 10.11 to the current long-term series, MariaDB 11.4, maintained until May 2029.

@kdambekalns kdambekalns self-assigned this Sep 24, 2024
container_name: local_beach_database
networks:
- local_beach
volumes:
- {{databasePath}}:/var/lib/mysql
healthcheck:
test: "/usr/bin/mysql --user=root --password=password --execute \"SHOW DATABASES;\""
test: "/usr/bin/mariadb --user=root --password=password --execute \"SHOW DATABASES;\""
Copy link
Member Author

Choose a reason for hiding this comment

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

As of MariaDB 11.0 the image no longer contains mysql-named binaries.

@@ -71,7 +71,7 @@ func handleStartRun(cmd *cobra.Command, args []string) {
}

log.Debug("Creating project database (if needed) ...")
commandArgs = []string{"exec", "local_beach_database", "/bin/bash", "-c", "echo 'CREATE DATABASE IF NOT EXISTS `" + sandbox.ProjectName + "`' | mysql -u root --password=password"}
commandArgs = []string{"exec", "local_beach_database", "/bin/bash", "-c", "echo 'CREATE DATABASE IF NOT EXISTS `" + sandbox.ProjectName + "`' | mariadb -u root --password=password"}
Copy link
Member Author

Choose a reason for hiding this comment

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

As of MariaDB 11.0 the image no longer contains mysql-named binaries.

@@ -177,6 +177,12 @@ func startLocalBeach() error {
return errors.New("failed to check for database server container health")
}
if strings.TrimSpace(output) == "healthy" {
commandArgs := []string{"exec", "local_beach_database", "mariadb-upgrade", "-u", "root", "--password=password"}
Copy link
Member Author

@kdambekalns kdambekalns Sep 24, 2024

Choose a reason for hiding this comment

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

This runs the upgrade – on every start. But since it does no harm to run it when not needed, I chose this way.

An alternative would be to check if the upgrade is needed (using mariadb-upgrade --check-if-upgrade-is-needed), but that seemed superfluous.

This upgrades the used MariaDB from version 10.11 to the current
long-term series, MariaDB 11.4, maintained until May 2029.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants