MySQL Step-by-Step Blog
2,614 FOLLOWERS
MySQL Step-By-Step blog is a place where you can find useful articles and posts about MySQL
MySQL Step-by-Step Blog
6y ago
There are two simple ways to backup only the users and privileges in MySQL:
1- Using mysqlpump utility (as create user and grant statements):
[shell ~]$ mysqlpump -uUSER -p --exclude-databases=% --add-drop-user --users > /tmp/pump-all-users_privileges-timestamp.sql
Dump completed in 1364 milliseconds
Sample output:
[shell ~]$ head /tmp/pump-all-users_privileges-timestamp.sql
-- Dump created by MySQL pump utility, version: 5.7.21-20, Linux (x86_64)
-- Dump start time: Sun May 13 23:30:49 2018
-- Server version: 5.7.21
SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0;
SET @OLD_F ..read more