Sign inSign up

greatsql/greatsql_shell

By greatsql

Updated 11 months ago

Docker images for GreatSQL-Shell

Image
Databases & storage
0

704

greatsql/greatsql_shell repository overview

Description

Run MySQL Shell for GreatSQL in Docker

Quick reference

Supported tags

How to use this image

Connect GreatSQL via tcp/ip

Create a new container to run MySQL Shell for GreatSQL

$ docker run -itd --hostname greatsqlsh --name greatsqlsh greatsql/greatsql_shell bash

Connect GreatSQL via tcp/ip

$ docker exec -it greatsqlsh bash -c "mysqlsh --uri [email protected]"
Please provide the password for '[email protected]': *************
MySQL Shell 8.0.32
...
Your MySQL connection id is 14891 (X protocol)
Server version: 8.0.32-25 GreatSQL, Release 25, Revision db07cc5cb73
No default schema selected; type \use <schema> to set one.
 MySQL  172.17.140.123:33060+ ssl  Py > c=dba.get_cluster()
 MySQL  172.17.140.123:33060+ ssl  Py > c.status()
{
    "clusterName": "mgr803225",
    "defaultReplicaSet": {
        "name": "default",
        "primary": "172.17.136.59:3306",
        "ssl": "REQUIRED",
        "status": "OK_NO_TOLERANCE",
        "statusText": "Cluster is NOT tolerant to any failures.",
        "topology": {
            "172.17.136.59:3306": {
                "address": "172.17.136.59:3306",
                "memberRole": "PRIMARY",
                "mode": "R/W",
                "readReplicas": {},
                "replicationLag": "applier_queue_applied",
                "role": "HA",
                "status": "ONLINE",
                "version": "8.0.32"
            },
            "172.17.140.123:3306": {
                "address": "172.17.140.123:3306",
                "memberRole": "SECONDARY",
                "mode": "R/O",
                "readReplicas": {},
                "replicationLag": "applier_queue_applied",
                "role": "HA",
                "status": "ONLINE",
                "version": "8.0.32"
            }
        },
        "topologyMode": "Single-Primary"
    },
    "groupInformationSourceMember": "172.17.136.59:3306"
}
 MySQL  172.17.140.123:33060+ ssl  Py >
 MySQL  172.17.140.123:33060+ ssl  Py > \sql
Switching to SQL mode... Commands end with ;
Fetching global names for auto-completion... Press ^C to stop.
 MySQL  172.17.140.123:33060+ ssl  SQL > show processlist;
+-------+-------------+----------------------+------+---------+---------+----------------------------------------------------------+----------------------------------+------------+-----------+---------------+
| Id    | User        | Host                 | db   | Command | Time    | State                                                    | Info                             | Time_ms    | Rows_sent | Rows_examined |
+-------+-------------+----------------------+------+---------+---------+----------------------------------------------------------+----------------------------------+------------+-----------+---------------+
|    12 | system user |                      | NULL | Connect | 1200070 | waiting for handler commit                               | Group replication applier module | 1200070613 |         0 |             0 |
...
| 14883 | GreatSQL    | 172.17.134.224:35392 | NULL | Query   |       0 | init                                                     | PLUGIN: show processlist         |          0 |         0 |             0 |
+-------+-------------+----------------------+------+---------+---------+----------------------------------------------------------+----------------------------------+------------+-----------+---------------+
7 rows in set (0.0028 sec)

Connect GreatSQL via unix socket

Or create a new container like this and mount the mysql.sock socket file

$ docker run -itd --hostname greatsqlsh --name greatsqlsh -v /data/GreatSQL/mysql.sock:/tmp/mysql.sock greatsql/greatsql_shell bash

Connect GreatSQL via unix socket

$ docker exec -it greatsqlsh bash -c "mysqlsh -S/tmp/mysql.sock"
Please provide the password for 'root@/tmp%2Fmysql.sock':
MySQL Shell 8.0.32
...
Fetching schema names for auto-completion... Press ^C to stop.
Your MySQL connection id is 178
Server version: 8.0.32-25 GreatSQL, Release 25, Revision db07cc5cb73
No default schema selected; type \use <schema> to set one.
 MySQL  localhost  Py > \sql
Switching to SQL mode... Commands end with ;
Fetching global names for auto-completion... Press ^C to stop.
 MySQL  localhost  SQL > show processlist;
+-----+-------------+-----------------+----------+---------+------+----------------------------------------------------------+----------------------------------+---------+-----------+---------------+
| Id  | User        | Host            | db       | Command | Time | State                                                    | Info                             | Time_ms | Rows_sent | Rows_examined |
+-----+-------------+-----------------+----------+---------+------+----------------------------------------------------------+----------------------------------+---------+-----------+---------------+
|  42 | GreatSQL    | 127.0.0.1:41682 | NULL     | Sleep   | 2469 |                                                          | NULL                             | 2468667 |         0 |             0 |
|  57 | root        | localhost       | greatsql | Sleep   | 2000 |                                                          | NULL                             | 2000318 |         8 |            33 |
...
| 178 | root        | localhost       | NULL     | Query   |    0 | init                                                     | show processlist                 |       0 |         0 |             0 |
+-----+-------------+-----------------+----------+---------+------+----------------------------------------------------------+----------------------------------+---------+-----------+---------------+
9 rows in set (0.0002 sec)

It works.

Tag summary

Content type

Image

Digest

sha256:1809a3dcf

Size

323.1 MB

Last updated

11 months ago

docker pull greatsql/greatsql_shell