When I'm trying
mysql -u mlimon -p
Then input the password it successfully login to the MySQL but when I'm trying something like this
mysql -umlimon -pmySqlPassword
Or
mysql -u mlimon -p mySqlPassword
OR
mysql -umlimon -p <<MY_QUERY
USE mysql
SHOW tables
MY_QUERY
It's returning
ERROR 1045 (28000): Access denied for user 'mlimon'@'localhost' (using password: YES)" Or something Error 1044 Access denied
My main intention to run some query in shell script but if I can't login directly to the database it's won't run and when I'm trying to pass the password it's showing access denied. but my question is why it's working when I'm imputing the password in command separately and not working with other way?
NOTE: my password contain a dollar sign, so is this something make the difference here?