Zilliz logo
Zilliz logo

Milvus Metadata Management (1)

How to View Metadata

December 25, 2019 by Zilliz

Link copied

We introduced some information about metadata in Managing Data in Massive-Scale Vector Search Engine. This article mainly shows how to view the metadata of Milvus.

Milvus supports metadata storage in SQLite or MySQL. There’s a parameter backend_url (in the configuration file server_config.yaml) by which you can specify if to use SQLite or MySQL to manage your metadata.

SQLite

If SQLite is used, a meta.sqlite file will be generated in the data directory (defined in the primary_path of the configuration file server_config.yaml) after Milvus is started. To view the file, you only need to install a SQLite client.

Install SQLite3 from the command line:

sudo apt-get install sqlite3

Then enter the Milvus data directory, and open the meta file using SQLite3:

sqlite3 meta.sqlite

Now, you’ve already entered the SQLite client command line. Just use a few commands to see what is in the metadata.

To make the printed results typeset easier for humans to read:

. mode column
. header on

To query Tables and TableFiles using SQL statements (case-insensitive):

SELECT * FROM Tables
SELECT * FROM TableFiles

1-use-sql-lite.png

Use SQLite3 to view metadata

MySQL

If you are using MySQL, you need to specify the address of the MySQL service in the backend_url of the configuration file server_config.yaml.

For example, the following settings indicate that the MySQL service is deployed locally, with port ‘3306’, user name ‘root’, password ‘123456’, and database name ‘milvus’:

db_config:
 backend_url: mysql://root:123456@127.0.0.1:3306/milvus

First of all, install MySQL client:

sudo apt-get install default-mysql-client

After Milvus is started, two tables (Tables and TableFiles) will be created in the MySQL service specified by backend_url.

Use the following command to connect to MySQL service:

mysql -h127.0.0.1 -uroot -p123456 -Dmilvus

Now, you can use SQL statements to query metadata information:

2-my-sql-view-meta-data.png

Use MySQL to view metadata

What’s coming next

Next articles will introduce in details the schema of metadata tables. Stay tuned!

Any questions, welcome to join our Slack channel or file an issue in the repo.

GitHub repo: https://github.com/milvus-io/milvus

If you like this article or find it useful, don’t forget to clap!

Make sense of

unstructured data.

Subscribe to our newsletter.