Following
mysql -u root -ppassword -D database -s -N -e "SELECT id FROM myTable"
with special password and database is working fine.
I want to split the code into two parts:
Executional part:
mysqlE=mysql -u root -ppassword -D database -s -N -e
and
MySQL command part:
query="SELECT id FROM myTable"
to execute it with something similar like:
mysqlE query
How can I do this?
ps
. See http://unix.stackexchange.com/a/205184/7696 for a better alternative. Remember tochmod 600
the config file. – cas Oct 21 '15 at 00:02