woocommerce list product by id

You should use “tax query” like this:

$args = array( 
    'post_type' => 'product', 
    'posts_per_page' => 5,
    'tax_query' => array(
        array(
            'taxonomy' => 'product_cat',
            'terms'    => 5,
        ),
    ),
);

Using taxonomy name (product_cat) as WP_Query parameter is deprecated.

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