【问题标题】:How to take output of MySQL SHELL utility in file如何在文件中获取 MySQL SHELL 实用程序的输出
【发布时间】:2020-02-13 06:26:06
【问题描述】:

我在 MySQL Shell 实用程序中以 JS 模式运行 util.checkForServerUpgrade() 函数。 我需要在文件而不是命令行中输出上述函数。

这是我使用的确切语法:

util.checkForServerUpgrade('root@localhost:3306', {"password":"abc", "targetVersion":"8.0.11", "outputFormat":"JSON", "configPath":"C:\ProgramData\MySQL\MySQL Server 5.7\my.ini"})

我已尝试添加 > output.json 以及更多内容,但对我不起作用。

【问题讨论】:

    标签: javascript mysql database-administration


    【解决方案1】:

    在mysqlsh ist启动时从命令行执行util.checkForServerUpgrade调用:

    mysqlsh root:****@localhost:3306 -e "util.checkForServerUpgrade('root@localhost:3306', {\"password\":\"abc\", \"targetVersion\":\"8.0.11\", \"outputFormat\":\"JSON\", \"configPath\":\"C:\ProgramData\MySQL\MySQL Server 5.7\my.ini\"})" > err.log
    

    【讨论】:

      猜你喜欢
      • 2016-09-02
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-03-06
      • 2021-12-07
      • 2012-02-25
      • 2015-08-30
      • 2015-02-28
      相关资源
      最近更新 更多