-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Automatically run mysql_upgrade for 8.0 image #416
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
Conversation
It is recommended to always run mysql_upgrade when upgrading MySQL, and it is required when upgrading from an older major version. Entrypoint script checks if mysql_upgrade has previously been run on the current version. If not it does a temporary startup and runs it.
local tmpdir=$1 | ||
chown mysql:mysql "$tmpdir" | ||
# We use skip-grant-tables since we can't know the root credentials of existing databases | ||
mysqld --skip-networking --pid-file="$tmpdir/mysqld.pid" --socket="$tmpdir/mysqld.sock" --daemonize --skip-grant-tables --log-error="$tmpdir/error.log" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs to use the same "$@"
logic we use for the other place we start the daemon, doesn't it? (which is slightly complicated by it being a shell function and "$@"
from the script itself being obscured)
Maybe we need to fully resolve what #402 starts (by functionalizing more parts of this file) so we can invoke the daemon in the same way (with a way to add --skip-grant-tables
for this use case)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I agree. I'll do some work on that first
Hi, |
This PR is no longer required as of MySQL 8.0.16: https://dev.mysql.com/doc/relnotes/mysql/8.0/en/news-8-0-16.html
|
For this image, the upgrade process is basically identical to the MySQL docs for upgrading the MySQL Server container: And since |
It is recommended to always run mysql_upgrade when upgrading
MySQL, and it is required when upgrading from an older major version.
Entrypoint script checks if mysql_upgrade has previously been run on the
current version. If not it does a temporary startup and runs it.
This should fix most issues related from latest tag having changed from 5.7 to 8.0