As stated in the reference manual:
mysqldump
does not dump the INFORMATION_SCHEMA
or performance_schema
database by default. To dump either of these, name it explicitly on the command line and also use the --skip-lock-tables
option. You can also name them with the --databases
option.
So that takes care of your concern about dumping those databases.
Now, to dump all databases, I think you should do something like this:
mysqldump -h Host -u User -pPassword -A -R > very_big_dump.sql
To test it without dumping all data, you can add the -d
flag to dump only database, table (and routine) definitions with no data.
As mentioned by Basile in his answer, the easiest way to ommit dumping the mysql
database is to invoke mysqldump
with a user that does not have access to it. So the punch line is: use or create a user that has access only to the databases you mean to dump.