Putty and Command Line (Windows)
Posted on 2011-02-22
I would think this is easy but I have been struggling with it all day.
I need to launch a putty window, login, and run two commands (login to mysql and run a SQL command) via an automated script (I was doing this through a batch file).
I cannot figure out how to automate the second two commands. Every time I run this .bat file, it successfully launches putty and logs me in, but it won't log me in to mysql or run the SQL statement (basically, my .bat file won't run the last two lines). Any ideas?? FYI, this does work if I manually type it in a putty window.
This is my .bat file:
mysql -u username -ppassword database_name
LOAD DATA LOCAL INFILE "/home/tmp/load_data.txt" INTO TABLE tablename FIELDS TERMINATED BY "," ENCLOSED BY '"';
I'm on a windows computer, by the way.
Thanks in advance!