MySQL Shell reserves certain variables as global variables, which are assigned to commonly used objects in scripting. This section describes the available global variables and provides examples of working with them. The global variables are:
sessionrepresents the global session if one has been established.
dbrepresents a schema if one has been defined (for example, by a URI-like connection string).
dbarepresents the AdminAPI, a component of InnoDB cluster which enables you to administer clusters of server instances. See InnoDB Cluster.
shellprovides general purpose functions, for example to configure MySQL Shell.
shell.reportsprovides built-in or user-defined MySQL Shell reports as functions, with the name of the report as the function.
utilprovides utility functions, for example to check server instances before an upgrade. See Chapter 7, MySQL Shell Utilities.
These words are reserved and cannot be used, for example as names of variables.