Can I set my WP_Query to be a Main Query?

This is an overly complicated approach. pre_get_posts will work for any query and there are numerous ways to control when/how the callback behaves:

  1. Add and remove the callback:

    function dummy_action($q) {
    
    }
    
    add_action('pre_get_posts','dummy_action');
    $q = new WP_Query(
      array(
        'post_type' => 'post'
      )
    );
    remove_action('pre_get_posts','dummy_action');
    
  2. Use a self-removing callback:

    function dummy_action($q) {
      remove_action('pre_get_posts','dummy_action');
    }
    
    add_action('pre_get_posts','dummy_action');
    $q = new WP_Query(
      array(
        'post_type' => 'post'
      )
    );
    
  3. Feed the query a parameter you can use as a trigger:

    function dummy_action($q) {
      if ($q->get('action_trigger')) {
        // do something
      }
    }
    
    add_action('pre_get_posts','dummy_action');
    $q = new WP_Query(
      array(
        'post_type' => 'post',
        'action_trigger' => true
      )
    );
    

You do not want to “assign” a secondary query as the main query. That will cause the same issues as caused by using query_posts(), which essentially does assign a secondary query as the main query.

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