I executed this in phpMyAdmin.
I executed these lines:
CREATE USER root IDENTIFIED BY PASSWORD '';
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' WITH GRANT OPTION;
I get this when trying to connect:
Connect failed: SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: NO)
$dsn = 'mysql:dbname=one';
$user = 'root';
$password = '';
$pdo = "Not set";
try{
$pdo=new PDO($dsn, $user, $password);
$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_WARNING);
}
catch(Exception $ex){
echo "Connect failed: " . $ex->getMessage();
}
Note that the connection above used to work..now it doesn’t (since I switched to XAMPP).