Dumping MySQL information schema
by Giuseppe Maxia
One of the recent MySQL enhancements was the INFORMATION_SCHEMA data dictionary, which gives a more coherent view on the DBMS meta-data.
Useful as it is, the information schema is becoming widely used, and many DBAs are learning how to use it as an administration and debugging tool. So useful, in fact, that it would be convenient, from time to time, to export its contents and pass it to a colleague to have a second opinion when a problem arises.
Unfortunately, there is no built-in tool to achieve this result. The standard mysqldump utility will skip the information schema on purpose. Since they are tables that are generated on-the-fly at server start-up, dumping them would not make sense to the normal user. However, the DBA is not a normal user, and such a dump would be highly desirable.
Here is a quick workaround that will produce a dump suitable for transferring the data to a new database.
In your script the necessary backslashes for your SQL Command, and concatenated perl lines are not presented in your display. For an inexperienced developer, this may be confusing, In fact for a moment I was looking for the $EG variable when first reading your script.