Task Scheduler in Windows Server 2008

J

Janet

I have the following command which runs great via the Command Line:
First I do: cd C:\Program Files\MySQL\MySQL Server 5.0\bin
then: mysql.exe --user=test --password=test testing_db -e "update
table set visible=1 where name='TC1';"

All works fine. I am trying to translate that into a Scheduled Task
using the Task Scheduler in Windows Server 2008.

In the Action area, under Program/Script I have:
"C:\Program Files\MySQL\MySQL Server 5.0\bin"

Under Arguments I have:
mysql.exe --user=test --password=test testing_db -e "update table set
visible=1 where name='TC1';"

It is not working. The error says "cannot find the file specified"
but I know the path is correct. If I specify the mysql or mysql.exe
at the end of the Program/Script line, I just get the basic mysql help
command line popup.

Can anyone tell me what I am doing wrong? How do I get this to work in
the Task Scheduler?
 
G

Greg Russell

I have the following command which runs great via the Command Line:
First I do: cd C:\Program Files\MySQL\MySQL Server 5.0\bin
then: mysql.exe --user=test --password=test testing_db -e "update
table set visible=1 where name='TC1';"

All works fine. I am trying to translate that into a Scheduled Task
using the Task Scheduler in Windows Server 2008.

Why not just create a trigger to automatically set the "visible" field when
name='TCI'?? http://dev.mysql.com/doc/refman/5.0/en/create-trigger.html
In the Action area, under Program/Script I have:
"C:\Program Files\MySQL\MySQL Server 5.0\bin"

Should be:
"C:\Program Files\MySQL\MySQL Server 5.0\bin\mysql.exe"
Under Arguments I have:
mysql.exe --user=test --password=test testing_db -e "update table set
visible=1 where name='TC1';"

Should be:
--user=test --password=test testing_db -e "update tablename set visible='1'
where name='TC1';"
It is not working. The error says "cannot find the file specified"
....

Just as it should, since the program/script you were trying to run was a
directory named "bin". Other errors would have ensued since there was also a
failure to quote the '1' in the SQL statement.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top