Using mysqldump and database users

The database users/passwords/privileges are kept in the mysql database, and won’t get dumped with your dump command. You’ll have to add that database as well to the list of DBs to dump:

mysqldump ... --routines --databases database_name mysql > backup.sql

or just dump everything:

mysqldump ... --routines --all-databases > backup.sql

Leave a Comment