January 2018
Intermediate to advanced
446 pages
12h 57m
English
In mysqldump, you will not get a backup of the users in CREATE USER or GRANT statements; instead you have to take a backup of the mysql.user table. Using mysqlpump, you can dump user accounts as account management statements (CREATE USER and GRANT) rather than as inserts into the mysql system database:
shell> mysqlpump --exclude-databases=% --users > users_backup.sql
You can also exclude some users by specifying the --exclude-users option:
shell> mysqlpump --exclude-databases=% --exclude-users=root --users > users_backup.sql