mysql script in shell using variables

I would like to use mysql syntax in my shell scripts with variables, what am I using wrong ?


mysql <MyBlaBlaDB> -e "select * from table where something = &1"

and I’m trying to run it as ./


try this way,


mysql -u [username] -p[password] [datbase name] -e "select * from table where something = $something"

Leave a Reply

Your email address will not be published. Required fields are marked *