<?php
$db = new PDO('mysql:host=localhost;dbname=test; user ="user";pass = "qwertqwerty');
$db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$q = $db->exec("CREATE TABLE dishes (
dish_id INT,
dish_name VARCHAR(255)
)");
?>
Fatal error: Uncaught PDOException: SQLSTATE[HY000] [1045] Access denied for user ''@'localhost' (using password: NO) in C:\OpenServer\domains\asd\database.php:15 Stack trace: #0 C:\OpenServer\domains\asd\database.php(15): PDO->__construct('mysql:host=loca...') #1 {main} thrown in C:\OpenServer\domains\asd\database.php on line 15