MySQL is an open-source relational database management system (RDBMS).

This page shows you how to import data into your Timescale Cloud service from database running on MySQL version 8 or earlier.

Before you import your data:

  • Install Docker on your migration machine.

    This machine needs sufficient space to store the buffered changes that occur while your data is being copied. This space is proportional to the amount of new uncompressed data being written to the Timescale Cloud service during migration. A general rule of thumb is between 100GB and 500GB.

For faster data transfer, best practice is for your source database, target service, and the system running the data import are in the same region .

To import data from a MySQL database:

  1. Setup the connection string for your target service

    This variable hold the connection information for the target Timescale Cloud service.

    In Terminal on the source machine, set the following:

    export TARGET=postgres://tsdbadmin:<PASSWORD>@<HOST>:<PORT>/tsdb?sslmode=require

    You find the connection information for your Timescale Cloud service in the configuration file you downloaded when you created the service.

  2. Setup the connection string for your source database

    SOURCE="mysql://<mysql_username>:<mysql_password>@<mysql_host>:<mysql_port>/<mysql_database>?sslmode=require"

    where:

    • <mysql_username>: your MySQL username
    • <mysql_password>: Your MySQL password
    • <mysql_host>: the MySQL server hostname or IP address
    • <mysql_port>: the MySQL server port, the default is 3306
    • <mysql_database>: the name of your MySQL database
  3. Import your data

    On your data import machine, run the following command:

    docker run -it ghcr.io/dimitri/pgloader:latest pgloader
    --no-ssl-cert-verification \
    "$SOURCE" \
    "$TARGET"
  4. Verify the data was imported correctly into your service

And that is it, you have imported your data from MySQL.

Keywords

Found an issue on this page?Report an issue or Edit this page in GitHub.