Using the DuckDB CLI
Installation
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.
- Windows
- macOS
- Linux
- Download the 64-bit Windows binary here
- Extract the Zip File.
- Run DuckDB using
./duckdb
There are two recommended options for installing on MacOS. You can install with Homebrew or download the binary.
Install with Homebrew
To install DuckDB, you can use the following command in the Terminal:
brew install duckdb
Run DuckDB using the command:
duckdb
Alternative: download the binary
- Download the binary here
- Extract the zip file.
- 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
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