I'm setting up a PHP script that connects to the 4D Database on my local system.
However, I keep getting:
Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[42000] [1044] Access denied for user ''@'localhost' to database 'tester'' in /Applications/MAMP/htdocs/4d/index.php:8 Stack trace: #0 /Applications/MAMP/htdocs/4d/index.php(8): PDO->__construct('mysql:host=loca...', 'XXXX', 'XXXX') #1 {main} thrown in /Applications/MAMP/htdocs/4d/index.php on line 8
I don't know HOW and WHERE to set the username & password for permissions for PHP to connect to the database :/
Any help is appreciated.
Simple code:
$db = new PDO('mysql:host=localhost;dbname=tester', "tester", "");
try {
echo "OK";
} catch (PDOException $e) {
die("Error 4D : " . $e->getMessage());
}