Quote:
I want to use mysqldump to back up by database.
If I have to restore the database to another MySQL server I would like
all the grants and permissions to be the same. It seems then that I
should not only back up my database but also the information_schema and
mysql databases. Is this the correct strategy? |
Yes, you should back up the 'mysql' database. On restoring it, I think
the procedure needs to go like this:
1. Make sure your database exists (without necessarily having
anything in it).
2. Restore the 'mysql' database.
3. Restore your database.
'information_schema' is a virtual database that is constructed on
the fly out of other information. You can't restore it in a
conventional sense, and if you try dumping it, it will complain
about locking. Restore the other databases and it will come back.