Milvus uses SQLite as metadata management service in the backend by default. SQLite is embedded in the Milvus process, so there is no need to run additional services. However, in production, it is strongly recommended that you use MySQL as metadata management service because of reliability.
Follow the steps below to use MySQL as metadata management service in Linux:
Pull the latest image of MySQL:
$ docker pull mysql:5.7
Launch MySQL service. You can set your own password and port.
$ docker run -p 3306:3306 -e MYSQL_ROOT_PASSWORD=123456 -d mysql:5.7
Use root account and the IP of the host that runs MySQL service (
<MySQL_server_host IP>) to log in MySQL. Press <ENTER> to enter the password you set in the previous step.
$ mysql -h<MySQL_server_host IP> -uroot -p
Enter MySQL client command line interface to create a database. Here we use
milvusas the database name.
mysql> create database milvus;
Quit MySQL client and update the
meta_uriparameter in server_config.yaml. Use the IP of the host that runs MySQL service (
<MySQL_server_host IP>). Note that the password, IP address, port, and database name must be consistent with your previous settings.
meta_uri: mysql://root:123456@<MySQL_server_host IP>:3306/milvus
Use the updated server_config.yaml to launch Milvus.
Why does Milvus return
If you use SQLite to manage metadata, you receive this error message when write requests occur frequently. We recommend using MySQL for metadata management. See Manage Metadata with MySQL for more information.
database is locked?
Why can't I find vectors on SQLite or MySQL?Milvus stores vectors and indexes directly in the disk as files, not in SQLite or MySQL. It uses SQLite or MySQL to store metadata of the vectors instead. See Storage Concepts for more information.
Can I use SQL Server or PostgreSQL to store metadata in Milvus?No, we only support storing metadata using SQLite or MySQL.
From data import, data storage to data querying and scheduling, our blogs on Medium provide detailed insights into the data management mechanism of Milvus.