WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Multisite phpmyadmin-delete multiple tables with prefix wp_xx_ (3 posts)

  1. valuser
    Member
    Posted 1 year ago #

    Trying to delete multiple wp multisite tables in phpmyadmin

    Example Task

    delete all tables belonging to site id 73 (currently there are 9 tables)

    i can identify the tables as wp_73_commentmeta, wp_73_comments, etc etc

    Entered the code below in the SQL tab of phpmyadmin

    SELECT CONCAT( 'DROP TABLE ', GROUP_CONCAT(table_name) , ';' )
        AS statement FROM information_schema.tables
        WHERE table_schema = 'istheplaDBbb9h3' AND table_name LIKE 'wp_73_%';

    and clicked Go

    the code appears to be accepted and while the tables appear to be identified nothing happens as no rows (0-0) are deleted

    see template image of result at http://i.imgur.com/sjoVP0J.png

    Obviously I am omitting something or am in the wrong tab!

    Any help at all much appreciated

  2. valuser
    Member
    Posted 1 year ago #

    a part solution is :

    DROP TABLE wp_73_commentmeta,wp_73_comments,wp_73_links,wp_73_options,wp_73_postmeta,wp_73_posts,wp_73_terms,wp_73_term_relationships,wp_73_term_taxonomy;

    but if there are lots of tables a wildcard solution would be best ?

    It must be out there somewhere!

  3. valuser
    Member
    Posted 1 year ago #

    ok

    my slow brain has come up with a solution

    with print view from my initial query I can get a ready made drop statement and that is that!

Topic Closed

This topic has been closed to new replies.

About this Topic