> For the complete documentation index, see [llms.txt](https://mariadb.com/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://mariadb.com/docs/tools/community/mariadb-shell/connecting.md).

# Connecting to a Server

How MariaDB Shell connects to MariaDB Server: connection URIs, local sockets, option files, TLS, SSH tunnels, compression, and stored passwords.

MariaDB Shell connects to MariaDB Server, and to MySQL servers, over the classic client/server protocol through MariaDB Connector/C. You describe the target with a connection URI such as `mariadb://dba@db1.example.com:3306/shop`, with a dictionary of connection options in Python, or with command-line options such as `-h`, `-P`, and `-u`.

The pages in this section explain each part of a connection, from the URI syntax to tunnels and stored passwords.

{% hint style="info" %}
To open a first connection and learn how the global session works, see [Sessions](/docs/tools/community/mariadb-shell/getting-started/sessions.md).
{% endhint %}

{% columns %}
{% column %}
{% content-ref url="/pages/uA5JpQvX6p3VClmxJiwt" %}
[Connection URIs and Options](/docs/tools/community/mariadb-shell/connecting/connection-uris-and-options.md)
{% endcontent-ref %}
{% endcolumn %}

{% column %}
The URI syntax with the `mariadb://` scheme, connection dictionaries, the connection command-line options, and which setting wins when they overlap.
{% endcolumn %}
{% endcolumns %}

{% columns %}
{% column %}
{% content-ref url="/pages/2iQhFOehA613I8lEgmFU" %}
[Sockets and Named Pipes](/docs/tools/community/mariadb-shell/connecting/sockets-and-named-pipes.md)
{% endcontent-ref %}
{% endcolumn %}

{% column %}
Local connections through a Unix socket file, or through a named pipe on Windows.
{% endcolumn %}
{% endcolumns %}

{% columns %}
{% column %}
{% content-ref url="/pages/UPyoyScfxCsd2WUAh9C7" %}
[Option Files and Login Paths](/docs/tools/community/mariadb-shell/connecting/option-files-and-login-paths.md)
{% endcontent-ref %}
{% endcolumn %}

{% column %}
The option files and groups that MariaDB Shell reads at startup, and how it uses `~/.mylogin.cnf`.
{% endcolumn %}
{% endcolumns %}

{% columns %}
{% column %}
{% content-ref url="/pages/LslA5ykgystiPb8wgw7A" %}
[Encrypted Connections](/docs/tools/community/mariadb-shell/connecting/encrypted-connections.md)
{% endcontent-ref %}
{% endcolumn %}

{% column %}
The TLS modes and how they behave against MariaDB Server, certificates, revocation lists, ciphers, and protocol versions.
{% endcolumn %}
{% endcolumns %}

{% columns %}
{% column %}
{% content-ref url="/pages/cmhBKP7pumUrxEs4usYl" %}
[SSH Tunnels](/docs/tools/community/mariadb-shell/connecting/ssh-tunnels.md)
{% endcontent-ref %}
{% endcolumn %}

{% column %}
Reaching a server through SSH with a `mariadb+ssh://` URI or with the `--ssh` options.
{% endcolumn %}
{% endcolumns %}

{% columns %}
{% column %}
{% content-ref url="/pages/LigWx3jwFHN15HZqHsX8" %}
[Compressed Connections](/docs/tools/community/mariadb-shell/connecting/compressed-connections.md)
{% endcontent-ref %}
{% endcolumn %}

{% column %}
Turning on protocol compression for slow or metered links.
{% endcolumn %}
{% endcolumns %}

{% columns %}
{% column %}
{% content-ref url="/pages/qVHqoqW4ldBGI7qy0Ext" %}
[Credential Store](/docs/tools/community/mariadb-shell/connecting/credential-store.md)
{% endcontent-ref %}
{% endcolumn %}

{% column %}
How MariaDB Shell remembers passwords and other secrets, the helper used on each platform, and the functions that manage stored entries.
{% endcolumn %}
{% endcolumns %}

<sub>*This page is licensed: GPLv2*</sub>
