0
我想用grunt-grunt来创建一个数据库。
的问题是:如果我从壳创建该行正常工作:grunt shell创建数据库
mysql -uroot -pmypass -e "create database test"
相反,如果我使用咕噜咕噜壳它不喜欢这个工作:
shell: {
install_db: {
options: {
stdout: true,
stderr: true
},
command: [
'ssh [email protected] mysql -uroot -pmypass -e "create database test"',
].join("&&")
}
}
“它不工作”是指打印出的参数列表为mysql
这样的:
Usage: mysql [OPTIONS] [database]
-?, --help Display this help and exit.
-I, --help Synonym for -?
--auto-rehash Enable automatic rehashing. One doesn't need to use
'rehash' to get table and field completion, but startup
and reconnecting may take a longer time. Disable with
--disable-auto-rehash.
(Defaults to on; use --skip-auto-rehash to disable.)
-A, --no-auto-rehash
...
我也试过:
'ssh [email protected] mysql -uroot -pmypass -e \"create database test\"',
'ssh [email protected] mysql -uroot -pmypass -e create database test',
'ssh [email protected] mysql -uroot -p -e create database test',
和许多其他,同样的问题打印出mysql
命令的参数列表,它不会创建数据库。
为什么?