Redirection error after posting a comment on a custom type post

I think the solution is very easy. After registering you post type:

register_post_type( 'portfolio', $args );

flush_rewrite_rules();

flush_rewrite_rules will do it for you!

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