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
            Asked
            
        
        
            Active
            
        
            Viewed 52 times
        
    1 Answers
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
