HestonJames
Programmer
Hello Guys,
I'm relatively inexperienced when it comes to MySQL, this morning I've been working on a maintenance script for the database which optimizes tables within, deletes a bunch of old data and does a bunch of other small tasks.
I've saved this into a .SQL script, which I'm now planning to schedule using cron to run every day in the early hours, when the database is experiencing the least traffic.
I'm currently planning to action the script like so:
* 3 * * * mysql -h localhost -u root -D <mydbname> --password=<mydbpassword> < /myapp/tools/maintenance.sql > /tmp/results.sql
Now, one thing that concerns me a little is the fact that I'm having to pass in a root username/password, which in an ideal world I guess I wouldn't do?
Am I going along the right track to schedule this kind of tasks? or is there a better way of doing this?
I'm running MySQL 5.0, I have not GUI tools available as this is an embedded platform so only have command line available.
Thanks all,
Heston
I'm relatively inexperienced when it comes to MySQL, this morning I've been working on a maintenance script for the database which optimizes tables within, deletes a bunch of old data and does a bunch of other small tasks.
I've saved this into a .SQL script, which I'm now planning to schedule using cron to run every day in the early hours, when the database is experiencing the least traffic.
I'm currently planning to action the script like so:
* 3 * * * mysql -h localhost -u root -D <mydbname> --password=<mydbpassword> < /myapp/tools/maintenance.sql > /tmp/results.sql
Now, one thing that concerns me a little is the fact that I'm having to pass in a root username/password, which in an ideal world I guess I wouldn't do?
Am I going along the right track to schedule this kind of tasks? or is there a better way of doing this?
I'm running MySQL 5.0, I have not GUI tools available as this is an embedded platform so only have command line available.
Thanks all,
Heston