This question already has an answer here:
I'm trying to access MySQL and execute multiple large queries with a "here document" in a shell script.
Running the following command works perfectly fine:
/usr/bin/mysql -u username -ppassword -h localhost database
Running this command results in an Access Denied error:
/usr/bin/mysql -u username -ppassword -h localhost database << EOF --MySQL queries here EOF
This is the error I receive:
ERROR 1045 (28000) at line 3: Access denied for user 'username'@'localhost'
With the only difference in the two methods being the
<< EOF, why am I all of a sudden receiving an error?