Documentation Home
MySQL Shell for VS Code


MySQL Shell for VS Code  /  View MySQL Resources  /  DATABASE CONNECTIONS View

Pre-General Availability: 2023-01-18

3.1 DATABASE CONNECTIONS View

The DATABASE CONNECTIONS view enables you to make, save, and manage connections to a MySQL DBMS, a SQLite database, or an Oracle Cloud Infrastructure (OCI) compute instance through MySQL Database Service.

The DATABASE CONNECTIONS view provides:

Database and extension actions

You can perform the following actions from the DATABASE CONNECTIONS view toolbar:

  • Click + to add a new database connection.

  • Click the DB Connection Browser icon to open a tab showing your existing database connections.

  • Click the Reload icon to reload the connection list.

  • Click the Collapse All icon to show the connection names only and hide all connection tree items, such as schemas.

  • Click ... to open a context menu with the following actions:

    • Restart the Internal MySQL Shell Process

      Closes all MySQL Shell tabs and restarts the underlying process. Afterwards, the extension attempts to establish a connection automatically.

    • Connect to External MySQL Process

      Connects to a MySQL Shell instance using its address. If you leave the address blank, the extension attempts to open MySQL Shell from a local installation.

    • Relaunch Welcome Wizard

      Opens the Welcome Wizard to access helpful links or to install the MySQL Shell certificate and reload the VS Code window.

    • Reset MySQL Shell for VS Code Extension

      Resets the extension by deleting the web certificate and your settings directory.

    • File Bug Report

      Opens a new bug report in the Shell VSCode Extension category or copies the link for later use. It is possible to configure trusted domains from a Windows platform using this action.

Connection actions

Named connections are listed under the DATABASE CONNECTIONS view and each connection contains a hierarchy of data objects. Click > to expand the list of:

  • Schemas with the mysql schemas hidden by default

  • Tables, views, routines, and events

  • Table columns, indexes, foreign keys, and triggers

You can perform the following actions for each connection:

  • Click the Connect icon (>) to make a connection, open DB Notebook, and execute the \about command.

  • Click the Reload icon to reload database information.

Right-click each connection to perform the following actions:

  • Open DB Connection

    Connects to MySQL, open a tab for DB Notebook, and execute the \about command. This action closes a currently active connection tab.

  • Open DB Connection in New Tab

    Connects to MySQL and opens DB Notebook in a new tab. This action does not close any open connection tabs.

  • Open MySQL Shell GUI Console for this Connection

    Opens a MySQL Shell Consoles tab using the connection. The GUI Console shows the host name and port, the schema, and executes the \about command.

    SQLite

    The Open MySQL Shell GUI Console for this Connection option is not available for SQLite database connections.

  • Set this Connection as Default for Embedded SQL Extension Execution

    To set a default connection, you must install the extension without using a standalone MySQL Shell instance.

    SQLite

    The Set this Connection as Default for Embedded SQL Extension Execution option is not available for SQLite database connections.

  • Edit MySQL Connection

    Opens the Database Connection Configuration dialog for the connection.

  • Duplicate this MySQL Connection

    Creates an identical copy of the original connection, including all data objects, and adds it to the DATABASE CONNECTIONS view below the original connection.

    Note

    The connection name of the duplicate is identical to the original.

  • Delete MySQL Connection

    Removes the connection from the Database Connections tab.

  • Show MySQL System Schemas

    Adds the mysql schema, which is not visible by default.

    SQLite

    The Show MySQL Schemas option is not available for SQLite database connections.

  • Load Dump from Disk

    Opens a file browser from which you can select the directory that contains a MySQL Shell dump.

    SQLite

    The Load Dump from Disk option is not available for SQLite database connections.

  • Configure MySQL REST Service

    Creates a MySQL REST Service schema and reports the action under the MYSQL SHELL TASKS view.

    SQLite

    The Configure MySQL REST Service option is not available for SQLite database connections.

Schema actions

Right-click each schema to perform the following actions:

  • Dump Schema to Disk

    Opens your system's file browser from which you can select a directory to hold the compressed schema files. The extension reports this action under the MYSQL SHELL TASKS view. The output files are optimized for use with the MySQL DBMS.

  • Dump Schema to Disk for MySQL Database Service

    Opens your system's file browser from which you can select a directory to hold the compressed schema files. The extension reports this action under the MYSQL SHELL TASKS view. The output files are optimized for use with MySQL Database Service in OCI.

  • Copy to Clipboard

    Copies to your system's clipboard the name or CREATE DATABASE statement for the schema.

  • Drop Schema

    Executes the DROP DATABASE statement on the selected schema, which drops all tables in the schema and deletes the schema. You need the DROP privilege on the schema.

    Be very careful with this statement!

Table actions

Right-click each table to perform the following actions:

  • Show Data

    Executes the SELECT * FROM 'schema-name' 'table-name' query and publishes the results in DB Notebook. If the language mode is not SQL when you select this action, the extension calls the \sql command first.

  • Add Table to REST Service

    Provides basic authentication for the specified table (see Section 3.1.2, “MySQL REST Service”).

  • Copy to Clipboard

    Copies to your system's clipboard the name or CREATE TABLE statement for the table.

  • Drop Table

    Executes the DROP TABLE statement on the selected table, which drops the table definition and all data, all its partitions, all data stored in those partitions, and all partition definitions associated with the dropped table, and all triggers. You need the DROP privilege on the schema.