我正在使用Net::OpenSSH Perl模块连接到 SSH 服务器并执行以下代码:
my @cmd = 'mysql -e "SET GLOBAL general_log_file = $log"';
$ssh->system(@cmd);
这是正确的shell命令:
mysql -e "SET GLOBAL general_log_file = 'log_name'"
我收到以下错误:
ERROR 1064 (42000) at line 1: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
你看我的问题是如何正确解析变量。
你能帮我更正引用吗?我已经尝试了所有可能的变体。
谢谢你。