How to get the number of child categories a specific parent category has?

Use get_term_children()

$term_id = 2; // use get_queried_object()->term_id; to get the current term id
$taxonomy_name="mypages"; // use use get_queried_object()->taxonomy; to get the current taxonomy name
$countchildren = count (get_term_children( $term_id, $taxonomy_name ));
echo $countchildren;

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