How do I empty my MySQL Database?

Discussion in 'MySQL' started by Jetheat, Oct 5, 2006.

  1. #1
    I want to clear my Wordpress MySQL database but I dont want to delete it.

    How do I clear all the tables of data without deleting the structure or the database or the tables?

    Thanks,

    JH
     
    Jetheat, Oct 5, 2006 IP
  2. ccoonen

    ccoonen Well-Known Member

    Messages:
    1,606
    Likes Received:
    71
    Best Answers:
    0
    Trophy Points:
    160
    #2
    hop into either Navicat or your phpMyAdmin - anywhere you can run SQL on your DB. then execute this query for every table

    Delete from [tablename]

    I would backup the tables first though :)
     
    ccoonen, Oct 5, 2006 IP
  3. jezza chan

    jezza chan Active Member

    Messages:
    1,488
    Likes Received:
    70
    Best Answers:
    0
    Trophy Points:
    90
    #3
    1. Login into your phpmyadmin.
    2. Select the tables you want on the left handside.
    3. Check the tables you want to empty, there is a drop down menu at the bottom right, choose empty.

    Make sure you do a complete backup first
     
    jezza chan, Oct 5, 2006 IP
  4. Jetheat

    Jetheat Well-Known Member

    Messages:
    260
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    140
    #4
    Thanks guys, I'll try these suggestions.

    JH
     
    Jetheat, Oct 6, 2006 IP
  5. Jetheat

    Jetheat Well-Known Member

    Messages:
    260
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    140
    #5
    OK, this backfired.

    I wanted to empty the data but not have to reinstall the whole Wordpress blog again. In other words, I wanted to get rid of all the posts inside the blog.

    Any way I could do that?

    JH
     
    Jetheat, Oct 6, 2006 IP
  6. mad4

    mad4 Peon

    Messages:
    6,986
    Likes Received:
    493
    Best Answers:
    0
    Trophy Points:
    0
    #6
    In phpmyadmin click "Empty"
     
    mad4, Oct 6, 2006 IP
  7. Jetheat

    Jetheat Well-Known Member

    Messages:
    260
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    140
    #7
    Yeah, I did that but it made me reinstall my whole blog.
     
    Jetheat, Oct 6, 2006 IP
  8. blade_922

    blade_922 Well-Known Member

    Messages:
    396
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    110
    #8
    yeh u deleted the database structure. To delete the content, go into the table that has the content, and select all rows and drop them. :)
     
    blade_922, Oct 7, 2006 IP