sindresorhus / grunt-shell

Run shell commands
MIT License
949 stars 126 forks source link

import database to remote server #66

Closed AlessandroMinoccheri closed 10 years ago

AlessandroMinoccheri commented 10 years ago

Good morning, I would like to import a database inside a remote server. I have tried this

shell: {
                install_db: {
                    options: {
                        stdout: true,
                        stderr: true
                    },
                    command: [
                        "ssh user@demo.server.it mysql < /Volumes/www/database/mydb.sql --database db_test -u root -p password",
                    ].join("&&")
                }
            }

Return me this error:

 Enter password: ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)

Logically user root has all priviligies.

I have also tried:

"ssh user@demo.server.it mysql < /Volumes/www/database/mydb.sql --database db_test -u root -p",

and

"ssh user@demo.server.it",
    "sudo mysql < /Volumes/www/database/mydb.sql --database db_test -u root -p password",

Not works.

Have you ever tried to create a task like that?

Thanks

sindresorhus commented 10 years ago

Try asking on StackOverflow ;)

AlessandroMinoccheri commented 10 years ago

Already done http://stackoverflow.com/questions/22830645/grunt-import-database-from-shell

I hope that someone can answer :)