I am trying to execute a shell script to login to mysql as root and execute some commands, and in order to avoid putting the root's password in the command line, I am using heredoc format as shown below. However, mysql prompts me for the password despite the fact that I am giving it the right password.
Exactly the same syntax works perfect on some other hosts but not here.
Why?
mysql@myhost:MySQL> mysql -uroot -p -s -P3306 -e 'SELECT NOW();' <<EOF
> MyPassword
> EOF
Enter password: <---- why does it require manual password entry in here?
2014-12-23 14:57:25