Setup guide · Hosted MySQL

Connect PlanetScale, RDS, Cloud SQL or any hosted MySQL to Dataki

Dataki connects to MySQL directly, with a host, a port, a database, a user and a password. It connects from one fixed IP address, over TLS whenever the server offers it, so hosts that refuse unencrypted connections, like PlanetScale, TiDB and Azure, work as they are.

  1. Your MySQL host
  2. Direct connection over TLS
  3. Dataki
Setup
About 5 minutes.
Connects from
34.89.253.13, one fixed address to allow.
Encryption
TLS whenever the server offers it. The server certificate is not verified, and client certificates are not supported.
What it reads
Tables and views in the database you name.

01Before you start

  • A database reachable from the internet, or one you can open to a single address.
  • A user that can create users and grant privileges, or on PlanetScale, access to SettingsPasswords.

02Set it up

3 steps, about 5 minutes

  1. 01

    Create a read-only user

    Run this with your database's name and a long password.

    Run as an admin user
    CREATE USER 'dataki_reader'@'%' IDENTIFIED BY 'choose-a-long-password';
    GRANT SELECT, SHOW VIEW ON your_database.* TO 'dataki_reader'@'%';
    • PlanetScale does not support CREATE USER. Create a password with the Read-only role under SettingsPasswords instead.
    • On TiDB Cloud, user names carry your cluster's prefix, e.g. '4AbC1x.dataki_reader', in the statement and in Dataki.
  2. 02

    Let Dataki in

    If your host filters connections by address, allow 34.89.253.13. It is the only address Dataki connects from.

    • PlanetScale

      Connection details

      Connect, or SettingsPasswords. Port 3306.

      Letting Dataki in

      Open by default. A password can be limited to addresses with Manage IP restrictions.

    • Amazon RDS and Aurora MySQL

      Connection details

      Connectivity & security tab. On Aurora, use the reader endpoint.

      Letting Dataki in

      Public access on, then a security-group inbound rule for TCP 3306 from 34.89.253.13/32.

    • Google Cloud SQL for MySQL

      Connection details

      Instance Overview for the public IP.

      Letting Dataki in

      ConnectionsNetworkingAuthorized networks: add 34.89.253.13/32.

    • Azure Database for MySQL

      Connection details

      The host is <server>.mysql.database.azure.com.

      Letting Dataki in

      SettingsNetworking: a firewall rule for 34.89.253.13.

    • DigitalOcean

      Connection details

      Connection Details, public network. The port is 25060.

      Letting Dataki in

      Network AccessTrusted sources: add 34.89.253.13.

    • TiDB Cloud

      Connection details

      Connect, public endpoint. The port is 4000.

      Letting Dataki in

      Open by default. Restrict it under SettingsNetworkingAuthorized Networks.

    • MariaDB Cloud

      Connection details

      The service's Connect panel.

      Letting Dataki in

      Closed by default: add 34.89.253.13 to the allowlist under SettingsSecure Access.

  3. 03

    Add the connection in Dataki

    Open app.dataki.ai/connect and, under Database Connections, choose Connect MySQL. Fill in Host, Port, Database Name, Username and Password, then Test connection and Save Connection.

03Check it

Make sure it is right

Two checks, run while logged in as dataki_reader.

Which tables will Dataki see?

This is the list Dataki gives the model.

As dataki_reader
SELECT table_name, table_type
FROM information_schema.tables
WHERE table_schema = DATABASE() AND table_type IN ('BASE TABLE', 'VIEW')
ORDER BY table_name;

Is the user really read-only?

This must fail with an access-denied error.

As dataki_reader
CREATE TABLE dataki_write_check (id int);

04Worth knowing

What you will run into

One database per connection
Dataki reads the tables and views of the database named in the connection. Add a second connection for a second database.
Servers Dataki cannot reach
Users created with REQUIRE X509 or REQUIRE SUBJECT, which demand a client certificate, and servers on a private network only, such as Azure servers created with private access.

Free while we are in beta

Connect Hosted MySQL. Ask it something.

Once the data is where Dataki can read it, the first answer is a question away, and anything worth keeping becomes a dashboard with a link that stays live.

One data source
Free tier. Connect a second on any paid plan.
Read-only
Every query runs read-only. Dataki cannot change your data.
No card
There is nothing to cancel if you stop.