| Welcome to WebmasterWorld Guest from 220.127.116.11 |
register, free tools, login, search, subscribe, help, library, announcements, recent posts, open posts,
|Subscribe to WebmasterWorld|
|CronJob and MySql updates|
| 9:48 am on Dec 2, 2009 (gmt 0)|
Hi, I run a forum and need to run some updates to the mysql database every 24 hours via a cron job.
Here is my SQL Update query
update members set ID_GROUP="12" where ID_group="0"
so i want to put this in a file called update-group.sql
but not sure on the formate of the sql file.
i would like the sql file to contain the login info for the database aswell
can anyone help?
| 12:22 pm on Dec 7, 2009 (gmt 0)|
welcome to WebmasterWorld [webmasterworld.com], ulk26!
you can't put the login information in the sql file.
it is provided in the command line:
mysql -uusername -ppassword databasename <update-group.sql
| 12:27 pm on Dec 7, 2009 (gmt 0)|
Thanks for the reply, what format do i need to put in the sql file
or is it a case of just putting in my update query?
| 3:08 pm on Dec 7, 2009 (gmt 0)|
yes you simply put the sql statements in the .sql file and use stdin or pipe it into your mwsql command.
| 3:25 pm on Dec 7, 2009 (gmt 0)|
All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved