Search query with quotes

using the \’ escape works for me, so whatever is causing your issue is something else with your website. I checked with the code below:

$the_query = new WP_Query( ['post_type' => 'post', 's' => 'Hello\'s'] );
if ( $the_query->have_posts() ) {
  echo '<ul>';
  while ( $the_query->have_posts() ) {
     $the_query->the_post();
     echo '<li>' . get_the_title() . '</li>';
  }
     echo '</ul>';
     }

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