View Full Version : How to remove Table in Repair / Optimize Tables
webmastersun
08-06-2015, 03:35 PM
Hello,
As title mentioned, I want to remove some tables in Repair / Optimize Tables in Admincp
tables came from removed plugins but they are showing in Repair / Optimize Tables
Can I remove them from admin page or from database manually?
Thanks
MarkFL
08-06-2015, 03:49 PM
I think your best bet is to (make a backup first) and then manually remove the tables that are associated with products you no longer have installed from your database.
Obviously, a well-coded product will include "Uninstall Code" that removes any database structure changes that were made when installed.
webmastersun
08-06-2015, 03:55 PM
I think your best bet is to (make a backup first) and then manually remove the tables that are associated with products you no longer have installed from your database.
Where to find these tables?
Obviously, a well-coded product will include "Uninstall Code" that removes any database structure changes that were made when installed.
Of course I uninstalled plugins (products) from admincp but I don't know why some tables still existed in Repair / Optimize Tables
MarkFL
08-06-2015, 04:13 PM
If you don't know how to access your database on your server, it may be simpler to use manual SQL queries to drop the unneeded table(s).
For each table you want to remove, run the following manual SQL query:
DROP TABLE 'table_name'
where table_name is the name of the table you wish to remove.
Note: Of course, make a backup of your database first before performing these queries in case something goes wrong.
What I meant by my second comment was directed towards the authors of the products themselves (not you)...there should be uninstall code that removes created tables and added columns, etc. when a product is uninstalled. This way when a user uninstalls a product there are no database changes left behind that are no longer needed. :D
TheLastSuperman
08-06-2015, 06:06 PM
OR simply rename the table - https://dev.mysql.com/doc/refman/5.0/en/rename-table.html
This way its never deleted until you're 100% sure its not required, this also alleviates the need to re-import any single tables or for those not as experienced forgo the complete database restoration.
I always try to remember now-a-days to let others know to change first before deleting, same with old folders and files when cleaning up your server/ftp etc you CHMOD them to 000 instead of deleting, refresh the forum then navigate and check if no issues then delete the folders/files - if an error redo CHMOD and everything is back to normal. By simply changing first instead of deleting, it can save those not up to par on the process a mighty big migraine! So as we can see, for those who don't run backups on a normal basis or who might be frequenting this thread about to delete something before backing it up (database and/or files as well) that you could change it first to ensure its not needed, then delete if not required :cool:.
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.