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.
-
Choose your MindsDB installation path.
Create your free MindsDB Cloud account.
To get started with a Docker installation, begin with our Docker instructions.
-
Open your SQL client and connect to MindsDB.
If you do not already have a preferred SQL client, we recommend DBeaver Community Edition
-
Create a new MySQL connection.
-
Configure it using the following parameters, as well as the username and password you created above:
Host: mysql.mindsdb.com Port: 3306 Database: mindsdb
-
Create a new MySQL connection.
-
Configure it using the following parameters. Password remains empty.
Host: localhost Port: 47335 Database: mindsdb Username: mindsdb
-
-
Connect your data to MindsDB using the
CREATE DATABASE
syntax.Example taken from our Quick Start Guide.
-
You can now preview the available data with a standard
SELECT
.Example taken from our Quick Start Guide.
-
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.
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)
-
The
SELECT
syntax will allow you to make a prediction based on features.Example taken from our Quick Start Guide.
-
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