You sure can do it..
Just put your sql commands into a .sql file and use mysql < file.sql syntax
to to have them executed by mysql. And you can always use cron in Unix to do
it periodically.In your Unix box do:
man crontab
man cron
to learn more about cron jobs. You can also consult to
http://www.faqts.com/knowledge_base/view.phtml/aid/1005/fid/436
about cron jobs.

Gurhan


-----Original Message-----
From: Andrew Hazen [mailto:[EMAIL PROTECTED]]
Sent: Thursday, March 14, 2002 9:13 AM
To: [EMAIL PROTECTED]
Subject: automating mysql command


Hi folks,
Let me first say that I am used to using mysql through PHP rather than
command line . . .

And, as I understand it mysql does not support any sort of “timers”.

I need to use a Unix command like cron to automate either a mysql
command or php script to output a selection from a few mysql tables into
a comma separated values fixed width text file.

Can I just write the mysql commands as a .sql  file and tell Unix to
execute it? Or is there another way?

Andrew Hazen
Database Developer
Jatech Solutions Inc.
160 Bartley Drive
Toronto, ON
M4A 1E1
www.jatech.ca
416-288-9833




---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail
<[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php



---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to