Exclude custom post type from search conflict with get_posts

get_posts() uses WP_Query, so you are probably providing wrong arguments, it’s worth mentioning that the function has some default arguments.

This should get all posts of the CPT myCPT:

$args = array(
    'posts_per_page' => -1,
    'post_type'      => 'myCPT',
    'post_status'    => 'any',
);
$posts_array = get_posts( $args ); ?>

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