Problem with custom WP_Query and underlying pagination/posts_per_page

Stop overriding the default loop and use pre_get_posts instead. Like this:

function wpse_247208_custom_category_query( $query ) {
    // Return early for any situation you aren't interested in.
    if ( is_admin() || ! $query->is_main_query() || !is_category() ) {
        return;
    }

    $query->set( 'posts_per_page', 6 );

    // Don't use a global; create a function to populate this value
    // I just don't know how you created this value so I wanted to make sure 
    // it is represented.
    $featured_posts_to_exclude = get_featured_posts_to_exclude();
    // If we have posts to exclude -- add that argument
    if (!empty($featured_posts_to_exclude)) {
        $query->set('post__not_in', $featured_posts_to_exclude);
    }
}
add_action( 'pre_get_posts', 'hwl_home_pagesize', 1 );

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