gpt4 book ai didi

mysqldbcompare 失败,模式名称中包含 '-'

转载 作者:可可西里 更新时间:2023-11-01 07:19:58 24 4
gpt4 key购买 nike

以下命令失败

mysqldbcompare --server1=un:pw@server1 --server2=un:pw@server2 --difftype=sql store-staging:store-beta

错误如下:

mysqldbcompare: error: Cannot parse the specified database(s): 'store-staging:store-beta'. Please verify that the database(s) are specified in a valid format (i.e., db1[:db2]) and that backtick quotes are properly used when required. The use of backticks is required if non alphanumeric characters are used for database names. Parsing the specified database results in db1 = 'store' and db2 = 'store'.

我的问题是如何“转义”模式,以便它们可以作为此命令的一部分运行?

我已经尝试了以下所有方法:

'store-staging:store-beta'
"store-staging:store-beta"
`store-staging:store-beta`

'store-staging':'store-beta'
"store-staging":"store-beta"
`store-staging`:`store-beta`

他们都失败了。

最佳答案

很可能您打算用于 mysqldbcompare 的任何反引号在 mysqldbcompare 实际看到它们之前实际上已被 shell 解释。

尝试在引号内包含反引号以确保它们被正确传递,因此您的命令看起来像这样:

mysqldbcompare --server1=un:pw@server1 --server2=un:pw@server2 --difftype='`sql store-staging`:`store-beta`'

关于mysqldbcompare 失败,模式名称中包含 '-',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34722348/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com