Bug #80729 mysqlpump should enable --users by default
Submitted: 14 Mar 2016 13:36 Modified: 3 Aug 2016 5:26
Reporter: Morgan Tocker Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: mysqlpump Command-line Client Severity:S4 (Feature request)
Version:5.7.11 OS:Any
Assigned to: CPU Architecture:Any

[14 Mar 2016 13:36] Morgan Tocker
Description:
The option 'users' is very helpful, and most users will want it on by default.

Dumping users as sql statements is bad for user experience, as upon restore it needs a FLUSH PRIVILEGES command to be activated.  Restoring users by CREATE USER/GRANT commands does not.

How to repeat:
[root@mysqldb4 ~]# mysqlpump --help
mysqlpump  Ver 1.0.0 Distrib 5.7.11, for Linux (x86_64)
Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.

 ..
triggers                          TRUE
tz-utc                            TRUE
user                              root
users                             FALSE <---- Should be true
watch-progress                    TRUE

Suggested fix:
Change the default
[3 Aug 2016 5:26] MySQL Verification Team
Hello Morgan,

Thank you for the feature request!

Thanks,
Umesh
[16 Feb 2020 11:26] Daniƫl van Eeden
With 8.0.19 the situation is as follows:

When using mysqlpump with no options (the default is --all-databases):
--triggers and --routines are TRUE
--users is FALSE

The mysql.db, mysql.user, etc tables are not included in the dump.

And mysqldump does include these tables. The --flush-privileges option is not enabled by default, so after the restore a `FLUSH PRIVILEGES` is needed.

If one migrates from mysqldump to mysqlpump it is very easy to not notice the difference and have a backup that doesn't include users.

I see two possible options:
1. Set --users TRUE if --all-databases is used (and if dumping the mysql schema explicitly?)
2. Show a warning if --all-databases is used without --users

I think option 1 is the best solution