summaryrefslogtreecommitdiff
path: root/debian
diff options
context:
space:
mode:
authorDaniel Black <daniel@mariadb.org>2020-09-17 10:36:25 +1000
committerDaniel Black <daniel@mariadb.org>2020-09-30 17:51:29 +1000
commit216ed1793482ab7d17cbd784c28780aeb3d286ef (patch)
treeca6702b08b56f9fad7a867d19198f3c2deaf26ca /debian
parent25ede13611b3c1f736be22fc581a0c371d212f61 (diff)
downloadmariadb-git-216ed1793482ab7d17cbd784c28780aeb3d286ef.tar.gz
MDEV-22678: Debian Upgrade from MySQL-5.7 CE fails with "Plugin 'auth_socket' is not loaded
MySQL.com and Percona packages can be root auth_socket only. MariaDB uses unix_socket. As the root user, as the default Debian maintaince user, needs to be accessible to run mariadb-upgrade for a start, we make it accessible again.
Diffstat (limited to 'debian')
-rw-r--r--debian/mariadb-server-10.5.postinst13
1 files changed, 13 insertions, 0 deletions
diff --git a/debian/mariadb-server-10.5.postinst b/debian/mariadb-server-10.5.postinst
index 6decee78766..c29b3532cb2 100644
--- a/debian/mariadb-server-10.5.postinst
+++ b/debian/mariadb-server-10.5.postinst
@@ -103,6 +103,19 @@ EOF
rmdir $mysql_upgradedir 2>/dev/null || true
done
+ # Upgrading from mysql.com needs might have the root user as auth_socket.
+ # auto.cnf is a sign of a mysql install, that doesn't exist in mariadb.
+ # We use lsof to protect against concurrent access by mysqld (mariadb has
+ # its own projection). We make sure we're not doing this on a MySQL-8.0
+ # directory.
+ # This direct update is needed to enable an authentication mechanism to
+ # perform mariadb-upgrade, (MDEV-22678). To keep the impact minimal, we
+ # skip innodb and set key-buffer-size to 0 as it isn't reused.
+ if [ -f "$mysql_datadir"/auto.cnf ] && [ -f "$mysql_datadir"/mysql/user.MYD ] &&
+ [ ! lsof -nt "$mysql_datadir"/mysql/user.MYD > /dev/null ] && [ ! -f "$mysql_datadir"/undo_001 ]; then
+ echo "UPDATE mysql.user SET plugin='unix_socket' WHERE plugin='auth_socket';" |
+ /usr/sbin/mariadbd --skip-innodb --key_buffer_size=0 --default-storage-engine=MyISAM --bootstrap 2> /dev/null
+ fi
# Ensure the existence and right permissions for the database and
# log files. Use mkdir option 'Z' to create with correct SELinux context.