我想创建 bash 别名以通过 ssh 运行 mysql 查询
ssh vagrant@192.168.10.10 "mysql wp-theme -e 'DELETE * FROM wp_options where option_name like \'%_transient%\''";
但问题出在我试图转义'的
\'%_transient%\'
部分
我遇到错误
bash: -c: line 0: unexpected EOF while looking for matching `''
bash: -c: line 1: syntax error: unexpected end of file
最佳答案
过了一段时间我找到了解决方案
ssh vagrant@192.168.10.10 "mysql wp-theme -e 'DELETE FROM \`wp_options\` where \`option_name\` like \"%_transient%\";'"
关于通过ssh执行Mysql查询,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44495530/