MemSQL Documentation

MemSQL is a high-performance, in-memory database that combines the horizontal scalability of distributed systems with the familiarity of SQL.

Get Started    

Connecting to a Cloud Cluster

This topic describes how to connect to a cluster in MemSQL Cloud.

MemSQL Cloud clusters can be accessed by using any MySQL-compatible client or driver, including any third-party application or service that can connect to MySQL databases. See the How to Connect to MemSQL topic for more information and examples of how to connect to MemSQL using common tools and services, which applies to MemSQL Cloud clusters as well as on-premises MemSQL clusters.

Before you can connect to a MemSQL Cloud cluster, it must be configured with a security group, which allows connections from specified IP address ranges. If your client, driver, or application attempts to connect to the cluster from an IP address that is not specified in the applied security group, the connection will be refused. See the Managing Security Groups for more information.

DDL Endpoint and DML Endpoint

Two endpoints are provided for every MemSQL Cloud cluster: a Data Definition Language (DDL) endpoint, and a Data Manipulation (DML) endpoint. The DDL endpoint can be used to execute any supported DDL command, such as creating a new database, table, or user. The DML endpoint can be used to execute any supported DML commands, such as loading data, querying data, or replacing data. For more information, see the Supported Commands in MemSQL Cloud topic.

Secure Connections

To prevent an attacker from intercepting network traffic during a session, MemSQL allows optional secure connections by encrypting connection traffic with SSL. SSL is enabled by default for the primary administrator account that is created with a new cluster, but you can also authenticate without using SSL.

See the steps below to learn how to connect to a MemSQL Cloud cluster using SSL.

Connecting to Third-Party Applications and Services

Many third-party applications and services can connect to MemSQL Cloud clusters. In general, any third-party application that is MySQL-compatible will also connect to a MemSQL Cloud cluster. See the following topics for more information on how to connect common business intelligence and integration applications with MemSQL Cloud:

Connecting to a MemSQL Cloud Cluster Using a MySQL Client

To connect to a cluster in MemSQL Cloud, first ensure you have configured and applied a security group to the cluster to allow access for your MySQL client's origin IP address, and then follow the steps below:

  1. Go to the MemSQL Cloud Console and sign in.
  2. From the MemSQL Cloud Console, click Clusters on the left menu.
  3. From the Clusters pane, click your desired cluster from the left menu. The overview page for the cluster appears.
  4. From the cluster overview page, copy either the DDL or DML endpoint depending on the type of commands you want to execute.
  5. In a MySQL-compatible command-line client, enter the following connection string, replacing the <cluster-endpoint> with either the DDL or DML endpoint you copied in the previous step, and the <admin-username> with the administrator username for the cluster:
mysql --user=<admin-username> --host=<cluster-endpoint> --port=3306 --password --prompt="memsql> "
  1. Press Enter. You will be prompted for the administrator account's password.
  2. After providing the administrator account's password, press Enter. You are now connected to your MemSQL Cloud cluster.

Connecting to a MemSQL Cloud Cluster Over SSL

To connect to a cluster using SSL, you must first download the MemSQL Cloud Certificate Bundle from https://ca.memsql.com. This file contains the root and intermediate certificate authorities that are required to connect to a MemSQL Cloud cluster using a MySQL command-line client.

After you have downloaded the certificate bundle, complete the steps below:

  1. In a MySQL-compatible command-line client, enter the following connection string, replacing the <cluster-endpoint> with either the DDL or DML endpoint you copied in the previous step, the <admin-username> with the administrator username for the cluster, and <ca-bundle-path> with the location of the certificate bundle you downloaded earlier:
mysql --user=<admin-username> --host=<cluster-endpoint> --port=3306 --password --ssl-ca=<ca-bundle-path> --ssl-mode=verify_ca --prompt="memsql> "
  1. Press Enter. You will be prompted for the administrator account's password.
  2. After providing the administrator account's password, press Enter. You are now connected to your MemSQL Cloud cluster over SSL.

Connecting to a MemSQL Cloud Cluster Using ODBC or JDBC

MemSQL Cloud supports ODBC and JDBC connections to a cluster. Consider the following example connection strings, replacing the <cluster-endpoint>, <admin-username>, and <password> placeholder values with your own:

ODBC Example

Driver={MySQL ODBC 5.2 ANSI Driver};Database=information_schema;Server=<cluster-endpoint>;Port=3306;User=<admin-username>;Password=<password>;

JDBC Example

jdbc:mysql://<cluster-endpoint>:3306/information_schema

Connecting to a Cloud Cluster