To change the WordPress theme via MySQL, first see what theme is specified at the moment, for this, execute the SQL query via phpMyAdmin or MySQL client:
SELECT * FROM wp_options WHERE option_name = 'template' OR option_name = 'stylesheet' OR option_name = 'current_theme';
Next, see what themes are in the /wp-content/themes/ directory.
For example, to change to the standard Twenty Fifteen theme, let’s execute three SQL queries:
UPDATE wp_options SET option_value = 'twentyfifteen' WHERE option_name = 'template'; UPDATE wp_options SET option_value = 'twentyfifteen' WHERE option_name = 'stylesheet'; UPDATE wp_options SET option_value = 'Twenty Fifteen' WHERE option_name = 'current_theme';