2

How to recreate my problem

Creating the MonetDB Container

I have this setup (using windows with Docker Desktop).

Create the official monetdb docker container with the follwing command:

docker run -v $HOME/Desktop/monetdbtest:/monetdbtest -e 'MONET_DATABASE=docker' -e 'MONETDB_PASSWORD=docker' -p 50000:50000 -d topaztechnology/monetdb:latest

explanation what the command does: creates a monetdb container with a database called 'docker' and applies the password 'docker' to the default user called 'monetdb'. It also mounts my directory monetdbtest/ into the container.

Testing the container with DBeaver

I test the connection using DBeaver with the following credentials:

JDBC URL: jdbc:monetdb://localhost:50000/docker
host: localhost
port: 50000
Database/schema: docker
username: monetdb
password: docker

this works fine, i am able to connect and can exequte sql queries with dbeaver.

Using mclient within the container to send queries

I enter the container as root with the following command: docker exec -u root -t -i nostalgic_hodgkin /bin/bash (replace nostalgic_hodgkin with your randomly generated container name)

2. I navigate to my mounted directory

cd monetdbtest

then I test the connection with mclient:

mclient -h localhost -p 50000 -d docker

I get asked for user and password, so for user I enter monetdb and for password I enter docker. It works and I am in the mclient shell, able to execute SQL queries.

3. Since I don't want to always enter username and password I create a .monetdb file in the monetdbtest/ directory. It looks like this:

user=monetdb
password=docker
  1. Now I should be able to use the mclient command without entering user information. So I type this command:
mclient -h localhost -p 50000 -d docker

However I get the message: 'nvalidCredentialsException:checkCredentials:invalid credentials for user 'monetdb


I did everything according to the mclient manual. Maybe I missed something?

Bishares
  • 67
  • 1
  • 13

1 Answers1

2

You may need to export the environment variable DOTMONETDBFILE with value /monetdbtest/.monetdb. See the man page for mclient, especially the paragraph before the OPTIONS heading.

  • The [official docker image](https://github.com/topaztechnology/monetdb) does not provide that environment variable. The monetdb docker image is built on top of the Linux Alpine Image. I guess I have to somehow set it inside the Alpine container. Not sure how to do that. Also I believe this environment variable should not be required. The [manual](https://www.monetdb.org/documentation-Jan2022/admin-guide/manpages/mclient/) says "...If unset, mclient first looks for a file .monetdb in the current working directory...". – Bishares Feb 08 '22 at 16:05