It's my first time trying to insert some info in a mysql database with an executable .sh file.
I'm using the following bash script but it's not working. Obviously most of the vars below have been replaced and simplified for ease of understanding.
#!/bin/bash
mysql -D mydbname -u mydbuser -p mydbpass <<EOF
INSERT INTO mytable (mycolumn) VALUES ('myvalue') WHERE id = '13';
exit;
You can see that I only want to insert my value in the row where id = 13 and this row does exist.
I don't think i'm formatting the query properly am I?
EDIT : Ok after suggestions below i've now got this but it still doesn't work?
#!/bin/bash
mysql -D mydbname -u mydbuser -p mydbpass <<EOF
UPDATE mytable SET mycolumn = 'myvalue' WHERE id = '13';
exit;
INSERTdoesn't haveWHEREclause