I'm trying to simplify a load data local infile, by putting it into a .sh file, and bash to run it.
Here is my count_portal.sh file
mysql -h host -u root -p password
load data local infile
"/workplace/user/dump/count_portal.txt"
replace into table test.icqa_count_portal
fields terminated by '\t' lines terminated by '\n' ignore 1 lines;
And here is my bash script
bash /home/user/Desktop/count_portal.sh I get an output that doesn't do what it is designed to do. When I simply make the count_portal.sh contain mysql -h host it longs in when running the script.