I want to make a bash script that connects to my MySQL server and inserts some valuse from a txt file. I have written this down:
#!/bin/bash echo \"INSERT I
I use this and it works:
mysql -uroot -proot < infile
or select the database first
./mysql -uroot -proot db_name < infile
or copy the whole SQL into the clipboard and paste it with
pbpaste > temp_infile && mysql -uroot -proot < temp_infile && rm temp_infile