user1449369
user1449369

Reputation: 67

mysqldump bash script stopping at password "command not found"

Whenever I try to run the bash script, its taking my password as a command. I am receiving "command not found" at the password portion. If use -p in the script, it accepts it in the prompt, but not when the password is in the script.

How would I go about "escaping" the password so its taken as plain text and not a command?

I tried password="thepassword" and $password, etc, no avail

 #!/bin/bash
 date=`date +%A`

 mysqldump --opt -Q -u somedb -somecrazypassword usersomedb > /backup/backup-$date.sql 

Upvotes: 0

Views: 387

Answers (1)

vladkras
vladkras

Reputation: 17228

I think you forgot -p before like -psomecrazypassword

Upvotes: 2

Related Questions