Documentation Home
MySQL Shell 8.0
Related Documentation Download this Manual
PDF (US Ltr) - 376.8Kb
PDF (A4) - 371.1Kb
HTML Download (TGZ) - 74.7Kb
HTML Download (Zip) - 86.5Kb


MySQL Shell 8.0  /  Getting Started with MySQL Shell  /  MySQL Shell Global Variables

4.5 MySQL Shell Global Variables

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:

  • session represents the global session if one has been established.

  • db represents a schema if one has been defined (for example, by a URI-like connection string).

  • dba represents the AdminAPI, a component of InnoDB cluster which enables you to administer clusters of server instances. See InnoDB Cluster.

  • shell provides general purpose functions, for example to configure MySQL Shell. shell.reports provides built-in or user-defined MySQL Shell reports as functions, with the name of the report as the function.

  • util provides utility functions, for example to check server instances before an upgrade. See Chapter 7, MySQL Shell Utilities.

Important

These words are reserved and cannot be used, for example as names of variables.