WooCommerce PHP – If Product Category Has Children [duplicate]

You can get all child category by using parent category id, I am using this code for access child product category

$cat_id = 1; // A Category id 
$temp_terms = get_terms(array(
   'taxonomy' => 'product_cat',
    'parent' => $cat_id,
    'order_by' => 'name',
));

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