Can’t get term id for category archive

To get term_id of current taxonomy, use the following code snippet

$queried_object = get_queried_object();
$term_id = $queried_object->term_id;

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