What’s wrong with this wpdb query?

Try this, it worked for me:

    global $wpdb;
    $terms = $wpdb->get_col( $wpdb->prepare(
            "SELECT name
            FROM {$wpdb->terms}
            WHERE term_group = %d
            ORDER BY name ASC", primary_tag_id
            ));

What you are after is $wpdb->terms not $wpdb->wp_terms

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