【问题标题】:Linux - autocomplete prompting db passwordLinux - 自动完成提示数据库密码
【发布时间】:2014-04-12 04:40:38
【问题描述】:

如您所知,当您执行类似的查询时:

cat query.sql | mysql -u foo -p bar

然后提示您插入数据库密码。有没有办法自动完成这一步,而不是每次要执行查询时都输入密码?

【问题讨论】:

    标签: linux database autocomplete passwords


    【解决方案1】:

    您可以在home 目录中创建.my.cnf 选项文件,如下所示。

    [client]
    user=foo
    password=bar
    

    大多数 MySQL 程序可以从选项文件中读取启动选项。更多信息here

    【讨论】:

      猜你喜欢
      • 2015-11-11
      • 2019-07-12
      • 1970-01-01
      • 1970-01-01
      • 2015-02-24
      • 2011-02-21
      • 2013-10-15
      • 2015-12-03
      • 2018-12-31
      相关资源
      最近更新 更多