List:General Discussion« Previous MessageNext Message »
From:Graeme B. Davis Date:May 20 1999 2:33pm
Subject:Re: best way to wipe info
View as plain text  
And I replied (I don't know if it's the best way, but it's fast..).

delete from tablename;
delete from tablename2;

you don't have to be nasty :)

-graeme

----- Original Message -----
From: Xah Lee <xah@stripped>
To: <mysql@stripped>
Sent: Thursday, May 20, 1999 12:08 AM
Subject: Re: best way to wipe info


> Many people suggested:
>
> > DELETE FROM tablename
>
> Please note that my question asked for how to delete a database, not a
> table. Linux ignoramuses, please pay attention.
>
> Here's the question again: What is the 'best' (i.e. proper, standard,
> scalable, expedient etc.) way to delete all info in a given database but
> keeps the schema? (in mysql)
>
> (Btw, I'm aware that one can delete certain files in mysql data
directories
> as a solution. My question stands as it is.)
>
> Xah
> xah@stripped
> Home: http://www.best.com/~xah/PageTwo_dir/more.html
> Work: http://www.brainpower.com/
> "Perl my ass" (there are more than one way to express love, too!)
>
> Xah wrote
> > What's the standard way to wipe out every info in the database but keeps
the
> > schema?
> >
> > What I do now is to dump the database without data to a file, then drop
the
> > database, then create it, then load it back from the file. (just learned
> > from this mailing list)
> >
> >
> > $mysqldump --no-data --password --host=server_name1 db_name >
file_full_path
> > $mysqladmin --password --host=server_name1 --force drop db_name
> > $mysqladmin --password --host=server_name1 create db_name
> > $mysql --password --host=server_name1 db_name < file_full_path
> >
> >
> > Are there alternative? and what's the 'proper' way?
> >
> > Thanks.
> >
> > Xah
>
> ---------------------------------------------------------------------
> Please check "http://www.mysql.com/Manual_chapter/manual_toc.html" before
> posting. To request this thread, e-mail mysql-thread3607@stripped
>
> To unsubscribe, send a message to the address shown in the
> List-Unsubscribe header of this message. If you cannot see it,
> e-mail mysql-unsubscribe@stripped instead.
>
>

Thread
best way to wipe infoXah Lee19 May
Re: best way to wipe infoGraeme B. Davis19 May
  • Re: best way to wipe infoFraser MacKenzie19 May
    • Re: best way to wipe infoglen19 May
    • Re: best way to wipe infoPaul DuBois19 May
Re: best way to wipe infojkraai19 May
Re: best way to wipe infoPiet Wesselman19 May
Re: best way to wipe infounknown19 May
Re: best way to wipe infoXah Lee20 May
Re: best way to wipe infoSasha Pachev20 May
Re: best way to wipe infoThimble Smith20 May
Re: best way to wipe infoPaul DuBois20 May
Re: best way to wipe infoGraeme B. Davis20 May