How do you turn off clean URLs in the database?
In drupal 8 this setting has been removed:

'clean_url' configuration setting removed; clean URLs are autodetected each request

I checked the database, there is really no setting with this name.