List:General Discussion« Previous MessageNext Message »
From:Mohan L Date:November 18 2011 8:37am
Subject:Re: Script need for dropping databases
View as plain text  
On Fri, Nov 18, 2011 at 1:32 PM, a bv <vbavbalist@stripped> wrote:

> Hi,
> I have a linux box running mysql plus  phpmyadmin  which has tables
> getting montly data and when a new month starts a new table is
> created. I want to store only 2 years of data  so when a new month
> starts  i need to drop the table which became the data container of 2
> years previous data. So to make this job auto, i need a linux/mysql
> script which will run on cron etc . Can you please help me
> for a correct script ? (i cant say im a database guy :-)
>
> It may help :
http://www.cyberciti.biz/faq/how-do-i-empty-mysql-database/

and you can also use something like :

#!/bin/bash
mysql dbnane<<EOFMYSQL
DROP table table_name;
CREATE TABLE table_name;
EOFMYSQL

Thanks & Rg
Mohan L

Thread
Script need for dropping databasesa bv18 Nov
  • Re: Script need for dropping databasesMohan L18 Nov
  • Re: Script need for dropping databasesNuno Tavares18 Nov