Skip to content

Commit

Permalink
Many changes to all the 'Connect to Sky DBs' pages ... needs review/v…
Browse files Browse the repository at this point in the history
…alidation. But, much better than what it was ...
  • Loading branch information
jramnara committed Apr 13, 2024
1 parent 27aa06a commit 15a47f3
Show file tree
Hide file tree
Showing 3 changed files with 182 additions and 34 deletions.
144 changes: 144 additions & 0 deletions docs/Connecting to Sky DBs/Connect using MariaDB CLI
Original file line number Diff line number Diff line change
@@ -0,0 +1,144 @@

MariaDB Client is available for Linux and Windows


## (I) Installation
Installation of MariaDB Client varies by operating system.

### CentOS / RHEL
1. Configure YUM package repositories:

```shell
$ sudo yum install wget
$ wget https://downloads.mariadb.com/MariaDB/mariadb_repo_setup
$ echo "30d2a05509d1c129dd7dd8430507e6a7729a4854ea10c9dcf6be88964f3fdc25 mariadb_repo_setup" \
| sha256sum -c -

$ chmod +x mariadb_repo_setup

$ sudo ./mariadb_repo_setup \
--mariadb-server-version="mariadb-10.11"
```

2. Install MariaDB Client and package dependencies:

```shell
$ sudo yum install MariaDB-client
```

### Debian / Ubuntu
1. Configure APT package repositories:

``` shell
$ sudo apt install wget

$ wget https://downloads.mariadb.com/MariaDB/mariadb_repo_setup

$ echo "30d2a05509d1c129dd7dd8430507e6a7729a4854ea10c9dcf6be88964f3fdc25 mariadb_repo_setup" \
| sha256sum -c -

$ chmod +x mariadb_repo_setup

$ sudo ./mariadb_repo_setup \
--mariadb-server-version="mariadb-10.11"

$ sudo apt update
```

2. Install MariaDB Client and package dependencies:

```shell
$ sudo apt install mariadb-client
```

### SLES
1. Configure ZYpp package repositories:

```shell
$ sudo zypper install wget

$ wget https://downloads.mariadb.com/MariaDB/mariadb_repo_setup

$ echo "30d2a05509d1c129dd7dd8430507e6a7729a4854ea10c9dcf6be88964f3fdc25 mariadb_repo_setup" \
| sha256sum -c -

$ chmod +x mariadb_repo_setup

$ sudo ./mariadb_repo_setup \
--mariadb-server-version="mariadb-10.6"
```

2. Install MariaDB Client and package dependencies:
```shell
$ sudo zypper install MariaDB-client
```

### Windows
1. Access [MariaDB Downloads](https://mariadb.com/downloads/community/community-server/) for MariaDB Community Server.

2. In the "Version" dropdown, select the version you want to download.

3. In the "OS" dropdown, select "MS Windows (64-bit)".

4. Click the "Download" button to download the MSI package.

5. When the MSI package finishes downloading, run it.

6. On the first screen, click "Next" to start the Setup Wizard.

7. On the second screen, click the license agreement checkbox, and then click "Next".

8. On the third screen, select the components you want to install. If you only want the standard MariaDB Client tools:

- Deselect "Database instance".
- Deselect "Backup utilities".
- Deselect "Development Components".
- Deselect "Third party tools".

When only "Client programs" is selected, click "Next".

9. On the next screen, click "Install".

10. When the installation process completes, click "Finish".

## (II) Connect
### Linux
1. Determine the connection parameters for your MariaDB SkySQL service.

2. Use your connection parameters in the following command line:

```shell
mariadb --host dbpwf03798702.sysp0000.db1.skysql.com --port 3306 --user dbpwf03798702 -p --ssl-verify-server-cert
```

- Replace 'dbpwf03798702.sysp0000.db1.skysql.com' with the Fully Qualified Domain Name of your service.

- You can use 3307 for the port if running with Replicas. This is the read-only port of your service.

- Replace the user name with the one for your service.

4. After the command is executed, you will be prompted for the password of your database user account. Enter the default password for your default user, the password you set for the default user, or the password for the database user you created.

### Windows
1. Fix your executable search path.

2. On Windows, MariaDB Client is not typically found in the executable search path by default. You must find its installation path, and add that path to the executable search path:

```shell
$ SET "PATH=C:\Program Files\MariaDB 10.6\bin;%PATH%"
```

3. Use your connection parameters in the following command line:

```shell
mariadb --host dbpwf03798702.sysp0000.db1.skysql.com --port 3306 --user dbpwf03798702 -p --ssl-verify-server-cert
```

- Replace 'dbpwf03798702.sysp0000.db1.skysql.com' with the Fully Qualified Domain Name of your service.

- You can use 3307 for the port if running with Replicas. This is the read-only port of your service.

- Replace the user name with the one for your service.

4. After the command is executed, you will be prompted for the password of your database user account. Enter the default password for your default user, the password you set for the default user, or the password for the database user you created.

72 changes: 38 additions & 34 deletions docs/Connecting to Sky DBs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,6 @@

This page describes how to connect to a SkySQL database using a MariaDB-compatible client.

!!! Note
The easiest way to get a SQL connection to any MariaDB database launched within your SkySQL account is through the built-in [Query Editor](https://mariadb.com/docs/skysql-dbaas/connect/nr-query-editor/) - run queries directly in the browser to interact with data stored in SkySQL databases.


!!! Note
💡 For Enterprise Server With Replica(s), you can also use any MongoDB client and use the [NoSQL Interface](https://mariadb.com/docs/skysql-dbaas/connect/nr-nosql-interface/) .


## Connection Parameters

Expand All @@ -23,63 +16,74 @@ Once your DB service is launched, click on the ‘Connect’ option for your ser
💡 **If you are not sure or unable to obtain the IP address, you can use 0.0.0.0/0 to effectively disable the firewall. Goes without saying — don’t do this for your production DBs.**


For more details go to the [Firewall](https://mariadb.com/docs/skysql-dbaas/security/nr-firewall/) settings page.
For more details go to the [Firewall](/docs/Security/Configuring%20Firewall.md) settings page.

Connection parameters include:

- Default username
- Default password
- Hostname (Fully Qualified Domain Name)
- TCP port
- PEM file containing the Certificate Authority Chain
- TCP port (3306 or 3307)
- ssl-verify-server-cert (if SSL is ON)

To connect to a service, you must also manage the [Firewall](https://mariadb.com/docs/skysql-dbaas/security/nr-firewall/) settings and add the client's IP address or netblock to the allowlist.

![https://mariadb.com/docs/_images/screenshots/services-tx-xpand-connect-params.png](https://mariadb.com/docs/_images/screenshots/services-tx-xpand-connect-params.png)

*Service-specific Connection Parameters*
![Connect window example](connect_window.png)



## Connecting using the MariaDB client

If using a mac, install MariaDB using `brew install mariadb`. Go through [MariaDB Client](https://mariadb.com/docs/skysql-previous-release/connect/clients/mariadb-client/) for details on how to connect from Linux or Windows.

Next, If you turned SSL, you need to download the ‘Certificate Authentication Chain’ from the Connect popup.
If using a mac, install MariaDB using `brew install mariadb`. Go through [MariaDB Client](Connect%20using%20MariaDB%20CLI.md) for details on how to connect from Linux or Windows.

Finally, simply copy/paste the MariaDB CLI command as displayed in the Connect window.

## Connecting from your Application

Applications can connect to MariaDB SkySQL DBs using any of the below MariaDB supported connectors. There are several other connectors from the community too.

- [C](Connect%20from%20%E2%80%98C%E2%80%99%20App%20b31c2f5880a74e198c61a60e74076cec.md)
- [C++](Connect%20from%20%E2%80%98C++%E2%80%99%20App%20697a64cebee24fcf996e21450f1c32f0.md)
- [Java](Connect%20from%20Java%20App%2017bf88ae787b44a0bccb8d5eaac5f8ef.md)
- [Java R2DBC](Connect%20using%20Connector%20R2DBC%206f657edcac0849cb8ab4be6649ca71bd.md)
- [Node.js (JavaScript)](Connect%20from%20Node%20js%20App%20b63d489b6fbd426ab40d7f7f3be9025a.md)
- [ODBC API](Connect%20using%20ODBC%20890af3c0e7b9458d89f83509870a9ee0.md)
- [Python](Connect%20from%20Python%20App%208bc740a2fd7145e099b41cd1b1f7c289.md)
- [C](Connect%20from%20‘C’%20App.md)
- [C++](Connect%20from%20‘C++’%20App.md)
- [Java](Connect%20from%20Java%20App.md)
- [Java R2DBC](Connect%20using%20Connector%20R2DBC.md)
- [Node.js (JavaScript)](Connect%20from%20Node%20js%20App.md)
- [ODBC API](Connect%20using%20ODBC.md)
- [Python](Connect%20from%20Python%20App.md)
- [MongoDB Client](Connect%20from%20MongoDB%20clients.md)


!!! Note
💡 For Enterprise Server With Replica(s), you can also use any MongoDB client and use the [NoSQL Interface](Connect%20from%20MongoDB%20clients.md)


## Connecting from SQL tools

Clients listed here have been tested to properly connect with MariaDB SkySQL and execute queries.

!!! Note
💡 Unlike previous SkySQL versions, the current version no longer requires clients to supply the Server SSL Certificate for SSL connections. Customers who migrated from MariaDB corporation to SkySQL Inc can continue to use provided certificates (when using the previous SkySQL method for connecting). But, we strongly recommend moving to the connection properties as shown in the Connect window for your service

Most of the SQL clients and editors natively support MariaDB. Most often you can also just select 'MySQL' and connect to your SkySQL DB service.

- [Connecting using Java clients like Squirrel SQL](https://squirrel-sql.sourceforge.io/)
All you need to do is to make sure the "useSsl" property is set to 'true' if SSL is ON.
- [TablePlus](https://tableplus.com/download)
- If SSL was configured, you should set the SSL Mode option to 'ENFORCE' and not 'VERIFY-SERVER-CERT'.
- When using the "ENFORCE" SSL mode in TablePlus or any MySQL client, the client will still verify that the SSL certificate presented by the server is valid and trusted. This includes verifying that the certificate is issued by a trusted Certificate Authority (CA) and that it has not expired or been revoked.
- In the "ENFORCE" mode, the client requires the server to present a valid SSL certificate during the SSL handshake process. - The client will then verify the following aspects of the certificate:
- Certificate Chain: The client will check if the server's SSL certificate is part of a valid certificate chain, leading back to a trusted root CA certificate.
- Certificate Expiry: The client will verify that the server's SSL certificate has not expired.
- Certificate Revocation: The client may also check if the certificate has been revoked by the issuing CA.
- If any of these checks fail, the client will not establish the SSL connection and may display an error indicating that the certificate is not valid or trusted.
- [MariaDB CLI](Connect%20using%20MariaDB%20CLI.md)

!!! Note
💡 The links below point to the older version of Docs. In all cases you DO NOT need to pass any Certificates. Just set 'use SSL' where available to true when using SSL.

- [DBeaver](https://mariadb.com/docs/skysql-previous-release/connect/clients/dbeaver/)
- [dbForge Studio](https://mariadb.com/docs/skysql-previous-release/connect/clients/dbforge-studio/)
- [HeidiSQL](https://mariadb.com/docs/skysql-previous-release/connect/clients/heidisql/)
- [MariaDB Client](https://mariadb.com/docs/skysql-previous-release/connect/clients/mariadb-client/)
- [MariaDB Shell](https://mariadb.com/docs/skysql-previous-release/connect/clients/mariadb-shell/)
- [Microsoft Power BI](https://mariadb.com/docs/skysql-previous-release/connect/business-intelligence/)
- [MySQL Workbench](https://mariadb.com/docs/skysql-previous-release/connect/clients/mysql-workbench/)
- [Navicat](https://mariadb.com/docs/skysql-previous-release/connect/clients/navicat/)
- [SQLyog](https://mariadb.com/docs/skysql-previous-release/connect/clients/sqlyog/)
- [TablePlus](https://mariadb.com/docs/skysql-previous-release/connect/clients/tableplus/)

## Client Configuration

1. Manage the [Firewall](https://mariadb.com/docs/skysql-dbaas/security/nr-firewall/) settings and add the client's IP address or netblock to the allowlist.
2. Download the "Certificate Authentication Chain" PEM file by clicking the displayed PEM file link. The PEM file used for the current release of SkySQL is different from the PEM files used by SkySQL previous release.
3. Configure your client per the [Connection Parameters](https://mariadb.com/docs/skysql-dbaas/connect/nr-client-connections/#Connection_Parameters).
- While instructions are provided in the [Portal](https://mariadb.com/docs/skysql-dbaas/working/nr-portal/) for connecting with the MariaDB Client (`mariadb`), there are many compatible [programming language connectors](https://mariadb.com/docs/skysql-dbaas/connect/nr-client-connections/#Supported_Connectors) and [client applications](https://mariadb.com/docs/skysql-dbaas/connect/nr-client-connections/#Supported_Clients).

Binary file added docs/Connecting to Sky DBs/connect_window.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 15a47f3

Please sign in to comment.