title: mysqli::__construct(): authentication method unknown to the client [caching_sha2_password]x
body: <p>I've just installed xampp and I'm running a MySQL db locally on phpMyAdmin. I'm trying to output the contents of a database via a .php doc, but I'm getting two warnings when trying to do so:</p>
  
  <p>Warning: mysqli::__construct(): The server requested authentication method unknown to the client [caching_sha2_password] in C:\xampp\htdocs\footfallTracker\test.php on line 20</p>
  
  <p>Warning: mysqli::__construct(): (HY000/2054): The server requested authentication method unknown to the client in C:\xampp\htdocs\footfallTracker\test.php on line 20
  Connection failed: The server requested authentication method unknown to the client</p>
  
  <p>Here's the code I'm using:</p>
  
  <pre><code>     &lt;?php
  $servername = "localhost";
  $username = "root";
  $password = "*2470C0C06DEE42FD1618BB99005ADCA2EC9D1E19";
  $dbname = "footfall_tracking";
  
  // Create connection
  $conn = new mysqli($servername, $username, $password, $dbname);
  // Check connection
  if ($conn-&gt;connect_error) {
      die("Connection failed: " . $conn-&gt;connect_error);
  }
  
  $sql = "SELECT ID, Location, Date FROM footstep_count";
  $result = $conn-&gt;query($sql);
  
  if ($result-&gt;num_rows &gt; 0) {
      // output data of each row
      while($row = $result-&gt;fetch_assoc()) {
          echo "ID: " . $row["ID"]. " - Location: " . $row["Location"]. " - Date: " . $row["Date"]. "&lt;br&gt;";
      }
  } else {
      echo "0 results";
  }
  $conn-&gt;close();
  ?&gt; 
  </code></pre>