monetdb:关闭mclient上的密码 [英] monetdb: switch off password on mclient

查看:89
本文介绍了monetdb:关闭mclient上的密码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想访问monetdb数据库而不进行密码验证.我需要将代码放入bash脚本并自动执行一些查询.

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

命令

mclient -u monetdb -d database

询问密码,我想省略(默认密码是'monetdb').完成此命令后,我想输入数据库.

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.

在mclient开始分析命令行选项之前,它将读取一个.monetdb文件.如果设置了环境变量DOTMONETDBFILE,它将读取该变量指向的文件.取消设置后,mclient将在当前工作目录中搜索.monetdb文件,如果不存在,则在当前用户的主目录中搜索.monetdb文件.该文件可以包含标志用户,密码,语言,save_history,格式和宽度的默认值.例如,.monetdb文件中的一项将mclient的默认语言设置为mal,如下所示:language = mal.要禁用读取.monetdb文件的功能,请将变量DOTMONETDBFILE设置为环境中的空字符串.

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.

将其放入您的 .monetdb 文件中,您无需手动输入用户名和密码.

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

user=monetdb
password=monetdb

这篇关于monetdb:关闭mclient上的密码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆