Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I create a new database in Questdb?

Tags:

questdb

I would like to be able to separate multiple types of data in Questdb but it looks like I can't perform something like

CREATE DATABASE new_db;

But I get table expected error. Is is possible outside of SQL to add a new database?

like image 319
Doncarleone512 Avatar asked Sep 15 '25 14:09

Doncarleone512


1 Answers

What you could do is to run multiple different instances of QuestDB, each containing a different database. You just have to run those instances on different ports. If you are using Docker for example you could map the QuestDB port 9000 of the container for the first DB to another host port, for example 9001.

docker run -p 9001:9000 --name=First_DB_Name questdb/questdb

If you now want to create a new DB you can run another container on another host port, like for example:

docker run -p 9002:9000 --name=new_db questdb/questdb

You can then reach the different databases via these host ports. If you are working on the host itself, then the first db is reachable via http://localhost:9001 and the new db via http://localhost:9002, etc...

It's not a beautiful solution, but it works.

like image 116
WurzelseppQX Avatar answered Sep 18 '25 10:09

WurzelseppQX