Exclude category by slug in pre_get_posts?

Here’s one way with the following tax query:

'tax_query' => [
    [
        'taxonomy' => 'category',
        'field'    => 'slug',
        'terms'    => [ 'foo' ],
        'operator' => 'NOT IN'
    ],
],

where the foo term slug is excluded.

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)