Jump to content

Calling mysql in batch mode as Cron command - need for trailing "QUIT" ?


rupertrealbear

Recommended Posts

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?

 

  • 2 weeks later...
  • 2 weeks later...

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.