I am. Still getting this.
SQLSTATE[HY000] [2054] The server requested authentication method unknown to the client
If I put the code from config and install together, it looks like this, and it uses PDO:
$host = “localhost”;
$username = “mongoose”;
//$username = “root”;
//$password = “Melissa89”;
$password = “root”;
$dbname = “test”; // will use later
$dsn = “mysql:host=$host;dbname=$dbname”; // will use later
$options = array(
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION
);
try {
$connection = new PDO(“mysql:host=$host”, $username, $password, $options);
$sql = file_get_contents(“data/init.sql”);
$connection->exec($sql);
echo “Database and table users created successfully.”;
} catch(PDOException $error) {
echo $error->getMessage();
}
It is running into trouble when I create the PDO object and outputting $error->getMessage().
Doesn’t seem to matter if I switch the username or password (between the one the example gave and what I think my root one has.) Goes to the same error both times.