How to Customize Wp Default Title and a prefix

Try this code.

add_filter('wp_title', 'custom_title');
function custom_title($title) {
    if(is_single()) {
        $category = get_the_category(get_the_ID());
        if(!empty($category)){
            $categories = array('music','video');
            if(in_array($category[0]->slug,$categories)){
                return $category[0]->name.': '.$title;
            }
        }
    }
    return $title;
}

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