Skip to main content

Using the DuckDB CLI

Installation

caution

MotherDuck currently supports DuckDB 1.1.2 and it is compatible with any client version 0.10.2 through 1.1.2

Download and install the DuckDB binary, depending on your operating system.

  1. Download the 64-bit Windows binary here
  2. Extract the Zip File.
  3. Run DuckDB using ./duckdb

For more information, see the DuckDB installation documentation.

Connect to MotherDuck

You can connect to MotherDuck by executing the following in DuckDB CLI. DuckDB will automatically download and load the signed MotherDuck extension.

ATTACH 'md:';

DuckDB will prompt you to authenticate with MotherDuck using your default web browser. Follow the instructions displayed in the terminal.

Test your MotherDuck connection using the following command. It will run in the cloud to display a list of your MotherDuck databases.

show databases;

Congrats 🎉 You are connected!

Now you can create databases and switch between them. You can also connect to your local DuckDB databases alongside databases hosted in MotherDuck, and interact with both!

To know more about how to persist your authentication credentials, read Authenticating to MotherDuck

info

Note you can also connect to MotherDuck directly when starting DuckDB CLI by running the following command:

duckdb "md:"

Upgrading MotherDuck via the DuckDB CLI:

If you have previously installed the extension, but we have upgraded the service, you may need to run the FORCE INSTALL command as shown in the following example.

FORCE INSTALL motherduck