bulk delete specific database tables

3 posts / 0 new
Last post
#1 Sun, 02/17/2019 - 23:54
adamjedgar

bulk delete specific database tables

Is there a means of bulk deleting specific database tables...i have inadvertently installed an entire wordpress into a database that it shouldnt have gone into. However, i cannot simply delete the database as its being used by another web application on the server.

It might also be ok if we had the ability to do a find and delete based on a table prefix that would be good enough as all the wordpress tables start with wp_

Mon, 02/18/2019 - 14:32
scotwnw

Yes, goto your db server, open the DB. Mine says "There are too many tables to display. Find tables matching". Put in wp_ or what ever you want to search for. I just deleted some cpgX tables from a wp install where the same thing happened. As long as the tables are prepended with something you can search on, it can be deleted from the DB.

Or if there is no search then the DB is not big enough to not list the tables, so just select the ones to delete with a check mark and click "drop selected objects"
Of course backup the DB first in case you make mistake.

Mon, 02/18/2019 - 19:42
adamjedgar

thanks Scotwmw. Hey i also have stumbled across another option that actually works although the text information related to it says otherwise.

If one runs the uninstaller script for wordpress, although the script says it will delete the entire database, on my install only the tables related to wordpress in the database were removed...leaving the tables for Blesta intact.

I realise the mistake was mine for somehow stuffing this up in the first place (ie wordpress using blesta database), however, the pathway to undoing the wrong appeared to be fraught with peril because of misleading information being thrown by Virtualmin.

Perhaps Virtualmin developers could alter to the "text hints" so they better reflect what is actually being removed from a database when an uninstall script is about to be run? (ie "IF" the database is shared by another application, then only the tables related to the script itself will be removed, "ELSE" drop entire database?)

AJECreative is the home of $5 webhosting, $15/month VPS servers (1cpu,1gb RAM, 25GB storage)
Centos7, Debian9, or Ubuntu18LTS
Available Control Panels = Centos-Webpanel, Cyberpanel, or Virtualmin

https://ajecreative.com.au

Topic locked