简体   繁体   中英

monetdb: switch off password on mclient

I'd like to access monetdb database without password verification. I need this to put code into bash script and automatize some queries.

Command

mclient -u monetdb -d database

asks for password, which I'd like to omit (by default password is 'monetdb'). After this command I'd like to enter the database.

If it's not feasible, maybe there is a chance to pass the password (even with direct and visible text in code).

You can create a configuration file that contains your username and password.

Before mclient starts parsing command line options, it reads a .monetdb file. If the environment variable DOTMONETDBFILE is set, it reads the file pointed to by that variable instead. When unset, mclient searches for a .monetdb file in the current working directory, and if that doesn't exist, in the current user's home directory. This file can contain defaults for the flags user, password, language, save_history, format, and width. For example, an entry in a .monetdb file that sets the default language for mclient to mal looks like this: language=mal. To disable reading the .monetdb file, set the variable DOTMONETDBFILE to the empty string in the environment.

Put this into your .monetdb file and you won't have to manually enter your username and password.

user=monetdb
password=monetdb

我的最低要求已达到众所周知的Expect命令

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM