LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
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.

Notices


Reply
  Search this Thread
Old 07-27-2008, 07:01 PM   #1
Stephan_Craft
Member
 
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
paulsm4
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":
Quote:
crontab -e
3) Type in these commands:
Quote:
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
Stephan_Craft
Member
 
Registered: Jul 2008
Posts: 184

Original Poster
Rep: Reputation: 30
Thanks !
 
  


Reply


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

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

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

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