On Category page, How can I get the category ID?

$cat_id = get_queried_object_id(); – it’s that simple!

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