Taxonomy Parent Name

<?php
$term = get_term_by( 'slug', get_query_var( 'term' ), get_query_var( 'taxonomy' ) );
$parent = get_term_by( 'id', $term->parent, get_query_var( 'taxonomy' ) );
if($parent):
    echo $parent->name;
endif;
?>

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