Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

mysql command line password linux background

Status
Not open for further replies.

thedaver

IS-IT--Management
Jul 12, 2001
2,741
US
I'm trying to cope with a Linux command line issue.

I want to specify just the "-p" on the command line and type in the password at a prompt (interactively). However I also want to background the task using the "&" at the end of the command.

I haven't looked into suspend/resume (altered) linux stuff yet but was wondering if someone knew how to solve this:

This barfs because I didn't put the password in the command line.
\> mysql -uroot -p database < somesql.sql &

This works, but I'm putting the password on a command line (and into .bash_history).
\> mysql -uroot -pmypassword database < somesql.sql &

Thanks in advance.
 
Never, mind. I found that the process can be started with the Interactive approach, then supply the password. Once the job is running, I can press CTRL+Z to pause and then 'bg' to restart in the background. (again, for Linux)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top