Connect with Standard Ruby

You can get started with SingleStore (formerly MemSQL) and Ruby quickly. SingleStore is wire-compliant with MySQL, meaning connecting to SingleStore is as easy as connecting to a MySQL database.

The sections below describe how to connect your application. For a complete example, including samples of CRUD operations, refer to this GitHub repo.


  • Ruby (version 2.6.x or 3.x)

  • mysql2 gem

Connection Details

To connect your Ruby application to your SingleStore cluster (SingleStore DB or SingleStore Managed Service) you'll need the following:

  • Host: the endpoint (SingleStore Managed Service) or IP Address (SingleStore DB) for your cluster. You can find the endpoint in the SingleStore Portal.

  • Port: default is 3306

  • User: admin (SingleStore Managed Service) or root (SingleStore DB).

  • Password

  • Database

Here is an example of a Ruby connection for a SingleStore Managed Service cluster:

client =
        :host => "", 
        :username => "admin", 
        :password => "<admin password>", 
        :database => "test"

More Information

Using Stored Procedures: GItHub