mysqlsh
\c root@localhost
\q
Start mysqlsh
Connect to local database server as root@localhost
Quit
\h
session.help()
session.help('getSchemas')
dba.help('getCluster')
help
methods for 'session' object
help with 'getSchemas' method of 'session' object
help with 'getCluster' method of 'dba' object
\py
\sql
\js
shell.options.setPersist('defaultMode','sql')
invoke Python interpreter
invoke SQL interpreter
invoke javascript interpreter
Set SQL interpreter as default
\js
session.getSchemas()
\py
session.getSchemas()
\sql
show databases;
javascript
Show Databases
python
Show Databases
SQL
Show Databases
shell.listCredentials()
shell.deleteCredential("root@localhost")
shell.clearCredentials()
shell.getSession()
List stored credentials
Delete Credential from MySQL Shell Keyring
Remove all stored credentials
Shows which MySQL user you are currently connected as
shell.options
shell.status()
shell.setOption(history.autosave, 1)
Show current MySQL Shell Option settings
Shows status. Same as \s
Persist shell history between sessions
os.getcwd()
Show path of current working directory
\js
var cluster = dba.getCluster('myCluster');
cluster.status()
cluster.describe()
cluster.options()
dba.checkInstanceConfiguration()
dba.configureLocalInstance()
cluster.addInstance('icadmin@node2:3306')
cluster.switchToMultiPrimaryMode()
cluster.switchToSinglePrimaryMode()
cluster.setPrimaryInstance('node3')
cluster.setupRouterAccount('icadmin', {'update':1})
cluster.listRouters()
dba.upgradeMetadata()
javascript
Define 'cluster' object
Cluster Status
Describe cluster
Cluster options
Check Instance Configuration
Configure Local Instance
Add instance (needs extra options, see InnoDB cluster page)
Multiple R/W Primary mode
One R/W, multiple RO
Set Primary instance
Setup a Router account
List Routers
Upgrade Metadata