0
$servername = "localhost";
$username = "jaskaran";
$password = "India@123";

// Create connection
$conn = new mysqli($servername, $username, $password);

// Check connection
if ($conn->connect_error) {
  die("Connection failed: " . $conn->connect_error); 
}
echo "Connected successfully";

jaskaran has all access mysql and when i try with

mysql -u jaskaran -p it is working fine by when i try with php it does not why

error is The server requested authentication method unknown to the client

even i try this also

ALTER USER 'jaskaran'@'localhost' IDENTIFIED WITH mysql_native_password
BY 'India@123';

0 Answers0