Skip to content

Getting Started

MindsDB integrates with the most popular databases and also with the DBT and MLflow workflow you already have.

To try MindsDB right away, without bringing your own data or model, check out our Quick Start Guide.

  1. Choose your MindsDB installation path.

    To get started with a Docker installation, begin with our Docker instructions.

  2. Open your SQL client and connect to MindsDB.

    If you do not already have a preferred SQL client, we recommend DBeaver Community Edition

    1. Create a new MySQL connection.

      DBeaver Create Connection

    2. Configure it using the following parameters, as well as the username and password you created above:

          Host: mysql.mindsdb.com
          Port: 3306
          Database: mindsdb
      

      DBeaver Configure Connection

    1. Create a new MySQL connection.

      DBeaver Create Connection

    2. Configure it using the following parameters. Password remains empty.

          Host: localhost
          Port: 47335
          Database: mindsdb
          Username: mindsdb
      

      DBeaver Configure Connection

  3. Connect your data to MindsDB using the CREATE DATABASE syntax.

    Example taken from our Quick Start Guide.

    DBeaver Create Database

  4. You can now preview the available data with a standard SELECT.

    Example taken from our Quick Start Guide.

    DBeaver Preview Data

  5. Now you are ready to create your model, using the CREATE PREDICTOR syntax. If you already have a model in MLFlow, you can connect to your model as well.

    Example taken from our Quick Start Guide.

    DBeaver Create Predictor

    Example taken from our Docker Guide.

    mysql> CREATE PREDICTOR mindsdb.home_rentals_predictor
        -> FROM example_data (select * from demo_data.home_rentals)
        -> PREDICT rental_price
        -> USING url.predict='http://host.docker.internal:1234/invocations',
        -> format='mlflow',
        -> dtype_dict={"alcohol": "integer", "chlorides": "integer", "citric acid": "integer", "density": "integer", "fixed acidity": "integer", "free sulfur dioxide": "integer", "pH": "integer", "residual sugar": "integer", "sulphates": "integer", "total sulfur dioxide": "integer", "volatile acidity": "integer"};
    Query OK, 0 rows affected (0.21 sec)
    

  6. The SELECT syntax will allow you to make a prediction based on features.

    Example taken from our Quick Start Guide.

    DBeaver Home Rentals Prediction DBeaver Home Rentals Prediction Results

  7. To integrate your predictions into your DBT workflow, you will need to make four changes:

    mindsdb:
        type: mysql
        host: mysql.mindsdb.com
        user: mindsdb.user@example.com
        password: mindsdbpassword
        port: 3306
        dbname: mindsdb
        schema: example_data
        threads: 1
        keepalives_idle: 0 # default 0, indicating the system default
        connect_timeout: 10 # default 10 seconds
    
    version: 2
    
    models:
          - name: predicted_rentals
            description: "Integrating MindsDB predictions and historical   data"
    
    with predictions as (
        SELECT hrp.rental_price as predicted_price, hr.rental_price as actual_price
        FROM mindsdb.home_rentals_predictor hrp
        JOIN exampleData.demo_data.home_rentals hr
        WHERE hr.number_of_bathrooms=2 AND hr.sqft=1000;
    )
    select * from predictions;
    
    models:
        home_rentals:
            +materialized: view