Re: Importo mysql.user from 5.0 to 5.7

From: Axel Schwenke <axel.schwenke_at_gmx.de>
Date: Fri, 19 May 2017 15:16:55 +0200
Message-ID: <ofmr1s$8u4$1_at_dont-email.me>


The best way to migrate users (+passwords, +permissions) from one MySQL installation to another is to dump the GRANT statements for those users. There are several tools out there for that: pt-show-grants from Percona Tools or several recipes using SQL, Perl, PHP or Python to run the necessary SHOW GRANTS statements. I have my own Perl script for that.

The advantage of using GRANTS is, that the result is readable and editable by a human. You can selectively import only certain users or leave certain users out. Also by importing the GRANTS, you don't risk to reset the system tables in the `mysql` database, something that would happen when you import a raw dump of those tables. That might be fixable by running mysql_upgrade, but as Jerry said: this is only guaranteed to work for upgrading from version x.y to x.y+1. It often works for bigger jumps, but there is no guarantee. Received on Fri May 19 2017 - 15:16:55 CEST

Original text of this message