mysqldump and INFORMATION_SCHEMA database

HarkenBanks
HarkenBanks used Ask the Experts™
on
I just moved a database in the process of moving a website to a new server.  I did this using a "mysqldump --all-databases ... > mysql.dump" on the old and then a "mysql ... < mysql.dump" on the new server.  Everything appears to be just fine; all data appears to have been moved as desired.

Subsequently, however, in writing a new backup script for this mysql database on the new server, I found the following in the mysql documentation (http://dev.mysql.com/doc/refman/5.0/en/mysqldump.html):
mysqldump does not dump the INFORMATION_SCHEMA database. If you name that database explicitly on the command line, mysqldump silently ignores it.

Now, when I go to the new database, I can see that I seemed to have move INFORMATION_SCHEMA from the old system just fine.  For example SELECT * FROM USER_PRIVILEGES show me all the privileges I expect to see.  

So, I'm confused.  It seems that there is something I don't know about the INFORMATION_SCHEMA table (for example, maybe it gets built automatically from other data or something like that), the mysql docs are wrong, or I'm somehow misreading the docs (although what is stated seems quite clear).  

If you can shed some light on this situation, I would greatly appreciated it. Naturally, my primary concern is to get the backup right -- a critical thing, of course -- which means that I want to understand what I'm doing when using mysqldump in generally and, in particular, what the deal with INFORMATION_SCHEMA is.  

Thank you!
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Top Expert 2008
Commented:
>> maybe it gets built automatically from other data or something like that

That is correct. This database contains meta data about the data in the other databases, and it is maintained by the mysql server.

Author

Commented:
So, just to make sure we're 100% clear on this:  ALL of the data in INFORMATION_SCHEMA is metadata that is automatically generated by mysqld.  The implication here, then, is that there is no need to backup up INFORMATION_SCHEMA (as it will be regenerated automatically).  Is that correct?  
Top Expert 2008

Commented:
That is correct. This is why mysqldump automatically ignores this database.

Author

Commented:
Thank you for your insight/expertise!  Everything makes sense now, including why mysqldump would ignore INFORMATION_SCHEMA by default, why INFORMATION_SCHEMA appeared on a restore to a new server, and why I don't ever have to bother with backing up INFORMATION_SCHEMA).  

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial