summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorVicențiu Ciorbaru <vicentiu@mariadb.org>2016-12-12 02:57:07 +0200
committerVicențiu Ciorbaru <vicentiu@mariadb.org>2017-02-14 07:46:58 +0200
commitfdfdea40f1b9d029de59131f54096c1b044ffdfa (patch)
treea25d3f5e8a75650d48ae24b4827f2dfdd1623b1c /scripts
parente1f0f0dd06d5e6f606c962b09ab0f6c0f1197955 (diff)
downloadmariadb-git-fdfdea40f1b9d029de59131f54096c1b044ffdfa.tar.gz
MDEV-11170: MariaDB 10.2 cannot start on MySQL 5.7 datadir:
Fatal error: mysql.user table is damaged or in unsupported 3.20 format The problem stems from MySQL 5.7.6. According to MySQL documentation: In MySQL 5.7.6, the Password column was removed and all credentials are stored in the authentication_string column. If opening a MySQL 5.7.6 (and up) datadir with MariaDB 10.2, the user table appears corrupted. In order to fix this, the server must be started with --skip-grant-tables and then a subsequent mysql_upgrade command must be issued. This patch updates the mysql_upgrade command to also add the removed Password column. The password column is necessary, otherwise the mysql_upgrade script fails due to the Event_scheduler not being able to start, as it can't find Event_priv in the table where it ought to be. MySQL's version has column position 28 (0 index) vs our datadir version expects position 29.
Diffstat (limited to 'scripts')
-rw-r--r--scripts/mysql_system_tables_fix.sql6
1 files changed, 6 insertions, 0 deletions
diff --git a/scripts/mysql_system_tables_fix.sql b/scripts/mysql_system_tables_fix.sql
index ea1059cdd78..80d0ef714a3 100644
--- a/scripts/mysql_system_tables_fix.sql
+++ b/scripts/mysql_system_tables_fix.sql
@@ -164,6 +164,12 @@ ALTER TABLE user
MODIFY Host char(60) NOT NULL default '',
MODIFY User char(80) NOT NULL default '',
ENGINE=MyISAM, CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
+
+# In MySQL 5.7.6 the Password column is removed. Recreate it to preserve the number
+# of columns MariaDB expects in the user table.
+ALTER TABLE user
+ ADD Password char(41) character set latin1 collate latin1_bin NOT NULL default '' AFTER User;
+
ALTER TABLE user
MODIFY Password char(41) character set latin1 collate latin1_bin NOT NULL default '',
MODIFY Select_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,