monetdb

monetdb: properly creating and setting the configuration file .monetdb for a user other than monetdb


My goal is to connect to a newly created database named mydb through a new user named jpriest instead of the default user monetdb.

Following this question monetdb: switch off password on mclient and the answer provided, I configured a .monetdb file in the current working directory containing the following content:

user=jpriest
password=mypassword
language=sql 

however I received the following error message

InvalidCredentialsException:checkCredentials:invalid credentials for user 'jpriest'

I am trying to follow the Getting Started section that states :

To connect/login to the database server the first time,
you must use monetdb as user name and enter its default password: monetdb.

Once connected you may create new users, create new schemas, create tables etc.
It is also strongly recommended to change the default password of the monetdb system user
via ALTER USER SET PASSWORD command.

Since I have not managed to make it work any help is greatly appreciated!


Solution

  • After some research I solved the problem through the following steps:

    1. I deleted the .monetdb file I previously created.
    2. I created a dbfarm named mydbfarm via: monetdbd create mydbfarm
    3. I configured the monetdb deamon monetdbd that serves the connections to the databases in mydbfarm to listen to the port 54321 via: monetdbd set port=54321 mydbfarm
    4. I started my dbfarm named mydbfarm via: monetdbd start mydbfarm
    5. I created a database named mydb via: monetdb -p 54321 create mydb
    6. I released mydb via : monetdb -p 54321 release mydb
    7. I started mydb via : monetdb -p 54321 start mydb
    8. I connected to mydb thought mclient via: mclient -d mydb -p 54321. I typed monetdb for user and again monetdb for password
    9. If all steps are done correctly the SQL prompt should start.
    10. I proceeded with the following command to create a user jpriest with password monetdb, name inpap and schema "sys" via: CREATE USER "jpriest" WITH PASSWORD 'monetdb' NAME 'inpap' SCHEMA "sys";
    11. After that I log out of the sql prompt with \q and connect again to mydb but this time with the user jpriest that I created in step 10 via: mclient -d mydb -p 54321 and by typing userjpriest passwordmonetdb
    12. Then in the sql prompt we change the password of the user jpriest from monetdb to pass via the command: ALTER USER SET PASSWORD 'pass' USING OLD PASSWORD 'monetdb';
    13. Then exiting the prompt and creating the .monetdb file with the content :
    user=jpriest
    password=pass
    language=sql 
    

    will allow you to always log in as user jpriest with the password pass