MySQL
MySQL is a relational database commonly used for application data. DuckDB's MySQL extension can read from MySQL-compatible databases, which lets you copy selected data into MotherDuck from a DuckDB client.
How it works with MotherDuck
- Connect to MotherDuck from the DuckDB CLI, Python, or another DuckDB client.
- Install and load DuckDB's MySQL extension in that session.
- Attach the MySQL database, then create MotherDuck tables from selected MySQL tables or queries.
Example
INSTALL mysql;
LOAD mysql;
ATTACH 'host=localhost port=3306 user=my_user password=my_password database=my_database'
AS mysql_db (TYPE mysql);
CREATE TABLE my_table AS
SELECT *
FROM mysql_db.my_schema.my_table;