Set up MySQL as MLflow's Backend Store

You can follow these steps to create and configure a MySQL database for use as the MLflow backend store.


Steps to setup

  1. Log in to MySQL.

mysql -u root -p

Enter your MySQL root password when prompted.

  1. Create a new database.

CREATE DATABASE mlflow;

Replace mlflow_db with your preferred database name.

  1. Create a user (optional but recommended).

CREATE USER 'mlflow'@'%' IDENTIFIED BY 'mlflow';

Replace mlflow_user and your_password with your desired username and strong password.

  1. Grant privileges to the user.

GRANT ALL PRIVILEGES ON mlflow.* TO 'mlflow'@'%'; FLUSH PRIVILEGES;
  1. Exit MySQL.

EXIT;
  1. Test connection from your MLflow server machine.

mysql -u mlflow_user -p -h <mysql_host> mlflow_db
  1. Replace <mysql_host> with your MySQL server IP or hostname.


Example MLflow backend store URI for MySQL:

mysql+pymysql://mlflow:mlflow@10.100.11.10:3306/mlflow

Notes:

  • Make sure the MySQL server allows remote connections if MLflow runs on a different system.



  Last updated