It really depends on what you want to do. If all you are doing is issuing
delete and insert statements with no decision logic then prepare you
statements, place them in your file and then form the command line (or cron
job)

mysql -u username -p password < mysqlcomands.file

assuming that the cron job is running with the proper permissions it should
work just fine.

Cal
http://www.calevans.com

-----Original Message-----
From: Aires Lima Trindade <[EMAIL PROTECTED]>
To: Myql List <[EMAIL PROTECTED]>
Date: Tuesday, May 15, 2001 9:20 AM
Subject: Run Mysql command from a file.


>Hi all.
> I'm new in this list, so may be this questions has already done
>here.
> I need to update my database daily at midnight. I want some file
>from which I can connect to mysql, switch to some database and work into
>tables (basically with delete and load commands).
> How can I do this? I had a look to "Using mysql in batch mode" and "
>How to run SQL commands from a text file" but they wasn't clear for me.
> Does anybody can share with me old experience or a real example
>about this case?
> Thanks in advance.
>
>Aires Trindade.
>
>
>---------------------------------------------------------------------
>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