Query Custom Post Type Order By Taxonomy Field

You’re missing the tax_query key, and it needs to be a nested array:

$args = array(
    'post_type' => 'product',
    'posts_per_page' => -1,
    'tax_query' => array(
        array(
            'taxonomy' => 'product_cat',
            'terms' => $cat_id,
            'field' => 'term_id',
        ),
    ),
);

Check the documentation

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