rupertrealbear Posted September 16, 2008 Share Posted September 16, 2008 Hi I managed to alter something in my MySQL database (on a VPS) by creating a user "cron" with no priviledges and then granting it a few table-specific priviledges in the database in question. A small text file was created containing some MySQL statements: mysql -h localhost -u cron < quick.txt quick.txt just connected to the databse and updated the test field in a table called sample:- USE crontest; UPDATE sample SET test = "changes successful"; My plan is to use a cron job to perform some useful databse housekeeping one every minute. I notice that you are advised to use the "QUIT" command (if calling mysql in batch while logged in on the local machine). Would adding "QUIT;" at the end of quick.txt achieve that end? Quote Link to comment https://forums.phpfreaks.com/topic/124507-calling-mysql-in-batch-mode-as-cron-command-need-for-trailing-quit/ Share on other sites More sharing options...
fenway Posted September 29, 2008 Share Posted September 29, 2008 Sure, why not? Quote Link to comment https://forums.phpfreaks.com/topic/124507-calling-mysql-in-batch-mode-as-cron-command-need-for-trailing-quit/#findComment-653251 Share on other sites More sharing options...
rupertrealbear Posted October 14, 2008 Author Share Posted October 14, 2008 I have since found that the call to mysql is closed automatically so there is no need to "QUIT" Quote Link to comment https://forums.phpfreaks.com/topic/124507-calling-mysql-in-batch-mode-as-cron-command-need-for-trailing-quit/#findComment-664934 Share on other sites More sharing options...
fenway Posted October 14, 2008 Share Posted October 14, 2008 It's close implicitly because the php thread terminates. Quote Link to comment https://forums.phpfreaks.com/topic/124507-calling-mysql-in-batch-mode-as-cron-command-need-for-trailing-quit/#findComment-664949 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.