Output Title of Post’s Current Category

This is the simplest answer I could find so far:

$category = get_the_category(); echo $category[0]-> cat_name;

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