How to “deactivate” plugin if error in wordpress?

Solution:

My understanding is that plugin activation/deactivation is controlled by the wp_options table in the DB.

You might consider a second MySQL call that deactivates the specific plugin. You can get all active plugins using this:

SELECT * FROM wp_options WHERE option_name = 'active_plugins';

You can update the list with something like this:

UPDATE wp_options SET option_value = 'a:0:{}' WHERE option_name = 'active_plugins';

Obviously, you’d want to modify this to target the specific plugin.

I saw this method used here, in which the author is describing how to deactivate ALL plugins via a MySQL query. Hope this helps.