Learn how to integrate MindsDB with MariaDB to train and query machine learning models directly using standard SQL commands.
MindsDB is a third-party application that interfaces with MariaDB Server to provide Machine Learning capabilities through SQL. The interface is done via the Connect Storage Engine.
To get a functional MariaDB - MindsDB installation, one needs to install the following components:
MindsDB: follow the instructions in the project's .
Connect Storage Engine must be enabled for the integration to work. See .
MindsDB connects to MariaDB Server via a regular user to setup a dedicated database called mindsdb. Which user are used is specified within MindsDB's .
For example, if MindsDB is installed locally, one can create a user called mindsdb@localhost. MindsDB only authenticates via the plugin, hence one must set a password for the user:
The user must be granted the global privilege and all privileges on the mindsdb database.
Assuming MindsDB is in the python path one can start up MindsDB with the following parameters:
Make sure $CONFIG_PATH points to the appropriate MindsDB configuration file.
Always consult the project's for up-to-date usage scenarios as MindsDB is an actively developed project.
For a step-by-step example, you can consult the following .
If the connection between MindsDB and MariaDB is successful, you should see the mindsdb database present and two tables within it: commands and predictors.
MindsDB, as an AutoML framework does all the work when it comes to training the AI model. What is necessary is to pass it the initial data, which MindsDB retrieves via a SELECT statement. This can be done by inserting into the predictors table.
The values inserted into predictors act as a command instructing MindsDB to:
Train a model called 'bikes_model'
From the input data, learn to predict the 'count' column.
The input data is generated via the select statement 'SELECT * FROM test.bike_data'.
The select_data_query should be a valid select that MindsDB can run against MariaDB.
This page is licensed: CC BY-SA / Gnu FDL
CREATE USER mindsdb@localhost;
SET PASSWORD FOR mindsdb@localhost=PASSWORD("password");GRANT FILE ON *.* TO mindsdb@localhost;
GRANT ALL ON mindsdb.* TO mindsdb@localhost;python -m mindsdb --config=$CONFIG_PATH --api=http,mysqlINSERT INTO `predictors`
(`name`, `predict`, `select_data_query`)
VALUES ('bikes_model', 'count', 'SELECT * FROM test.bike_data');