Connect using Cloud Shell
Use any browser to connect to Yugabyte Cloud by using Cloud Shell. Cloud Shell doesn't require a CA certificate or any special network access configured.
You have the option of using the following command line interfaces (CLIs) in Cloud Shell:
- ysqlsh - YSQL shell for interacting with YugabyteDB using the YSQL API.
- ycqlsh - YCQL shell, which uses the YCQL API.
Limitations
Cloud Shell has the following security limitations:
- Sessions are limited to 15 minutes. If your session disconnects, close the browser tab and start a new session.
- You can only use a subset of ysqlsh meta-commands.
Cloud Shell known issues
Cloud Shell is updated regularly. Check the known issues list in the release notes for the most-current list of known issues.Connect via Cloud Shell
To connect to a cluster via Cloud Shell:
-
On the Clusters tab, select a cluster.
-
Click Connect.
-
Click Launch Cloud Shell.
-
Enter the database name and user name.
-
Select the API to use (YSQL or YCQL) and click Confirm.
The shell displays in a separate browser page. Cloud Shell can take up to 30 seconds to be ready.
-
Enter the password for the user you specified.
The ysqlsh
or ycqlsh
prompt appears and is ready to use.
ysqlsh (11.2-YB-2.6.1.0-b0)
SSL connection (protocol: TLSv1.2, cipher: ECDHE-RSA-AES256-GCM-SHA384, bits: 256, compression: off)
Type "help" for help.
yugabyte=#
Connected to local cluster at 3.69.145.48:9042.
[ycqlsh 5.0.1 | Cassandra 3.9-SNAPSHOT | CQL spec 3.4.2 | Native protocol v4]
Use HELP for help.
admin@ycqlsh:yugabyte>
If you enter an incorrect password, the shell session terminates immediately and you must start a new session.
ysqlsh meta-commands in Cloud Shell
Cloud Shell supports the use of ysqlsh meta-commands. However, for security reasons, some commands are not available. With the exception of read-only access to the /share
directory to load the sample datasets, commands that access the filesystem do not work in Cloud Shell.
The following table lists common meta-commands that can be used in Cloud Shell.
Command | Description |
---|---|
\c [database name] | Connect to a database. For example, \c yb_demo . |
\l | List all databases. |
\d | Display tables, views, and sequences. |
\dt | Display tables. |
\dv | Display views. |
\dm | Display materialized views. |
\di | Display indexes. |
\dn | Display schemas. |
\dT | Display data types. |
\du | Display roles. |
\sv [view name] | Show a view definition. |
\x [ on | off | auto ] | Toggle the expanded display. Used for viewing tables with many columns. Can be toggled on or off, or set to auto. |
\set | List all internal variables. |
\set [Name] [Value] | Set new internal variable. |
\unset [Name] | Delete internal variable. |
\timing | Toggles timing on queries. |
\echo [message] | Print the message to the console. |
\i [filename] | Execute commands from a file in the /share directory only. For example, \i share/chinook_ddl.sql . |
\q | Exits ysqlsh. |
Related information
- YSQL API — Reference for supported YSQL statements, data types, functions, and operators.
- YCQL API — Reference for supported YCQL statements, data types, functions, and operators.
- ysqlsh — Overview of the CLI, syntax, and meta-commands.
- ycqlsh — Overview of the CLI, syntax, and commands.