Defining global functions or variables.
The startup scripts are optional, and you can create them if you want to use them for customization. The startup scripts must be named as follows:
For Python mode:
You can place your startup scripts in any of the locations listed
below. MySQL Shell searches all of the stated paths, in the order
stated, for startup scripts with the file name
mysqlshrc and the file extension that matches
the scripting mode that is being initialized
.js by default if MySQL Shell is started
with no language mode specified). Note that MySQL Shell executes
all appropriate startup scripts found for the scripting mode, in
the order they are found. If something is defined in two different
startup scripts, the script executed later takes precedence.
In the platform's standard global configuration path.
share/mysqlshsubdirectory of the MySQL Shell home folder, which can be defined by the environment variable
MYSQLSH_HOME, or identified by MySQL Shell. If
MYSQLSH_HOMEis not defined, MySQL Shell identifies its own home folder as the parent folder of the folder named
binthat contains the mysqlsh binary, if such a folder exists. (For many standard installations it is therefore not necessary to define
In the folder containing the mysqlsh binary, but only if the MySQL Shell home folder described in option 2 is neither specified nor identified by MySQL Shell in the expected standard location.
<mysqlsh binary path>\mysqlshrc.[js|py]
<mysqlsh binary path>/mysqlshrc.[js|py]
In the MySQL Shell user configuration path, as defined by the environment variable
In the platform's standard user configuration path, but only if the MySQL Shell user configuration path described in option 4 is not specified.