Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.


  Search this Thread
Old 07-27-2008, 07:01 PM   #1
Registered: Jul 2008
Posts: 184

Rep: Reputation: 30
Empty table in MySQL

I have a table that I need to empty every day…
I use to go to my DirectAdmin and empty this table manually.
Is there a way to make this automatically? Through cron-tab in linux?
Old 07-27-2008, 07:18 PM   #2
LQ Guru
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Blog Entries: 1

Rep: Reputation: Disabled
Uh -

1) Log on as a user with permissions to execute mysql.

2) Edit your "crontab":
crontab -e
3) Type in these commands:
mysql -umyusername -pmypassword -D mydb -e "truncate mytable"
4) Run/monitor at least one job (to verify that it works).

'Hope that helps .. PSM
Old 07-28-2008, 05:02 AM   #3
Registered: Jul 2008
Posts: 184

Original Poster
Rep: Reputation: 30
Thanks !


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
QTParted (Empty Partition Table) Kloun Linux - General 12 06-16-2008 08:57 AM
empty routing table on bootup tiagolpadua Linux - Networking 0 02-26-2004 08:18 PM
MySQL non-realtime table-by-table mirroring Passive Linux - Software 1 01-20-2004 01:11 PM
How to import MS ACCESS Table including OLE filed into the MySQL Table ? myunicom Linux - General 1 11-28-2003 12:30 PM
How to empty database table?? edhan Linux - General 2 10-24-2003 09:53 PM > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 02:26 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration