Mysql batch file help

Mysql batch file help

am 08.08.2009 08:06:19 von nayan.darekar

Hi Guys,

I need a help, as i am new to mysql and i want to create a batch file that =
can truncate table and Load (LOAD DATA INFILE) one .csv file which is gener=
ated every 2min into that table.
I have created one batch file where i can only able to login into databse, =
further my commands are not working the code is as follows:
echo off
mysql -uroot -pasd123!@# mysql
truncate table cdma_dsr; ---- This line code is not working.

can any one tell me why it is not working.

Thanx and regards,
nayan d.

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=3Dgcdmg-mysql-2@m.gmane.o rg

Re: Mysql batch file help

am 08.08.2009 15:55:53 von Johnny Withers

You have to execute each command using the mysql command:

@echo off
mysql -u root -ppass --database test truncate table t1
mysql -u root -ppass --database test load data infile ....

On Saturday, August 8, 2009, DAREKAR, NAYAN (NAYAN)
wrote:
> Hi Guys,
>
> I need a help, as i am new to mysql and i want to create a batch file tha=
t can truncate table and Load (LOAD DATA INFILE) one .csv file which is gen=
erated =A0every 2min into that table.
> I have created one batch file where i can only able to login into databse=
, further my commands are not working the code is as follows:
> echo off
> mysql -uroot -pasd123!@# mysql
> truncate table cdma_dsr; =A0 =A0 =A0 ---- This line code is not working.
>
> can any one tell me why it is not working.
>
> Thanx and regards,
> nayan d.
>
> --
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe: =A0 =A0http://lists.mysql.com/mysql?unsub=3Djohnny@pixela=
ted.net
>
>

--=20
-----------------------------
Johnny Withers
601.209.4985
johnny@pixelated.net

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=3Dgcdmg-mysql-2@m.gmane.o rg

Re: Mysql batch file help

am 09.08.2009 03:56:06 von Michael Dykman

Aternatively, you can put all your MySQL commands into a single script
and excute that at the command like


==================== =====3D=
==========
-- contents of command file
truncate table cdma_dsr;
load data from infile ...
--end of command file
==================

mysql -u user -p mydatabase < commandfile.sql


On Sat, Aug 8, 2009 at 9:55 AM, Johnny Withers wrote:
> You have to execute each command using the mysql command:
>
> @echo off
> mysql -u root -ppass --database test truncate table t1
> mysql -u root -ppass --database test load data infile ....
>
> On Saturday, August 8, 2009, DAREKAR, NAYAN (NAYAN)
> wrote:
>> Hi Guys,
>>
>> I need a help, as i am new to mysql and i want to create a batch file th=
at can truncate table and Load (LOAD DATA INFILE) one .csv file which is ge=
nerated =A0every 2min into that table.
>> I have created one batch file where i can only able to login into databs=
e, further my commands are not working the code is as follows:
>> echo off
>> mysql -uroot -pasd123!@# mysql
>> truncate table cdma_dsr; =A0 =A0 =A0 ---- This line code is not working.
>>
>> can any one tell me why it is not working.
>>
>> Thanx and regards,
>> nayan d.
>>
>> --
>> MySQL General Mailing List
>> For list archives: http://lists.mysql.com/mysql
>> To unsubscribe: =A0 =A0http://lists.mysql.com/mysql?unsub=3Djohnny@pixel=
ated.net
>>
>>
>
> --
> -----------------------------
> Johnny Withers
> 601.209.4985
> johnny@pixelated.net
>
> --
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe: =A0 =A0http://lists.mysql.com/mysql?unsub=3Dmdykman@gmail=
..com
>
>



--=20
- michael dykman
- mdykman@gmail.com

Don=92t worry about people stealing your ideas. If they=92re any good,
you=92ll have to ram them down their throats!

Howard Aiken

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=3Dgcdmg-mysql-2@m.gmane.o rg