-3

i have some query and scp command in a shellscript on linux server and need to automate this shellscript how can i provide the database query password and scp password in the script only? so that bash will not prompt for passwords

rohinee
  • 35
  • 1
  • 7

1 Answers1

0

You can connect to mySql without the password prompt by using --password for example,

mysql -u user_id --password='mypassword' -h db_hostname db_name -e 'query' 

For scp see the answer posted here How to pass password to scp?

Dave Carruthers
  • 542
  • 1
  • 8
  • 29