How to get category names in post_class?

You have to pass the values, not echo them.

So something like this should work:

$post_cats = get_the_category();
$slugs = wp_list_pluck( $post_cats, 'slug' );
post_class( join( ' ', $slugs );

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