Grouping posts by a custom meta value

The answer by felipelavinz assumes that there is an array of dates stored in the post_meta of each post, but the way I read your question and sample code it seemed as though you have one date specified per post? If this is true (one date per post)

then the following would suit you better

<?php
// this is the correct equivalent to the get_posts call
// Don't use get_posts.
// you should also specify some "orderby" parameter
$entries = new WP_Query(array(
    'post_type' => 'cw_events',
    'posts_per_page' => -1,
    'order' => 'ASC'
));

dates = array(); //we will fill this up with dates in the loop

if ( $entries->have_posts() ) : while ( $entries->have_posts() ) : $entries->the_post();

    //WP_Post magic methods allow us to access meta values like so

    $dates[] = $post->event_date;

endwhile; endif;

$dates = array_unique( $dates );

// always user wp_reset_postdata() UNLESS interacting with the main query
wp_reset_postdata();

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