Will post_exists work for draft posts?

Yes, as post_exists("great title") runs the following SQL:

SELECT ID FROM $wpdb->posts WHERE 1=1 AND post_title="great title"

so there’s no post status or post type restriction.

Check the docs on post_exists() for more info.

If you want to restrict by post type, you can use:

$found_page = get_page_by_title( "great title", $output = OBJECT, $post_type="page" );

See the docs here.

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