nixCraft Linux Forum

nixCraft

Linux / UNIX Tech Support Forum

Delete all tables mysql under Linux

This is a discussion on Delete all tables mysql under Linux within the Databases servers forums, part of the Mastering Servers category; How do I delete all tables in mysql database server??? I need to delete all tables for database called wp ...

Register free or login to your existing account and remove all advertisements.


Go Back   nixCraft Linux Forum > Mastering Servers > Databases servers

Linux answers from nixCraft.


Databases servers Discussions of databases of all types - especially MySQL.

Reply

 

LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 06-09-2007, 01:40 AM
Senior Member
User
 
Join Date: Jun 2005
Posts: 137
Thanks: 21
Thanked 4 Times in 3 Posts
Rep Power: 5
jerry is on a distinguished road
Default Delete all tables mysql under Linux

How do I delete all tables in mysql database server??? I need to delete all tables for database called wp from command line. I' using CentOS linux

thanks
Reply With Quote
  #2 (permalink)  
Old 06-09-2007, 05:50 PM
nixcraft's Avatar
Never say die
User
 
Join Date: Jan 2005
Location: BIOS
OS: RHEL
Scripting language: Bash and Python
Posts: 2,674
Thanks: 11
Thanked 240 Times in 180 Posts
Rep Power: 10
nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute
Default

To delete all tables just drop database :P
Code:
drop database foo;
To delete all data from table bar:
Code:
TRUNCATE TABLE bar;
__________________
Vivek Gite
Linux Evangelist
Be proud RHEL user, and let the world know about your enterprise choices! Join RedHat user group.
Always use CODE tags for posting system output and commands!
Do you run a Linux? Let's face it, you need help
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 
Thread Tools
Display Modes

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads

Thread Thread Starter Forum Replies Last Post
Linux Recursively Delete Subdirectories raj Linux software 0 04-22-2008 01:50 AM
Linux delete mail for root or any other user from a shell prompt raj Getting started tutorials 0 05-05-2007 01:36 AM
Linux delete empty directories raj Getting started tutorials 0 05-05-2007 01:29 AM
Linux find and delete files cbzee Linux software 4 12-20-2006 12:01 PM
delete directory linux chiku Linux software 4 07-22-2006 06:56 PM


All times are GMT +5.5. The time now is 10:05 AM.


Powered by vBulletin® Version 3.8.4 - Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.2
©2005-2009 nixCraft. All rights reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38