vendredi 29 juillet 2016

fatal error - cannot connect to database

I'm trying to create a simple php blog and downloaded demo files from here - https://daveismyname.com/creating-a-blog-from-scratch-with-php-bp.

Creating database (named blog01) and tables was sucessful.

On index.php I have an error:
Fatal error: Uncaught exception 'PDOException' with message ' in D:localhostblog-01includesconfig.php on line 11

config.php:

define('DBHOST','localhost');
define('DBUSER','username');
define('DBPASS','password');
define('DBNAME','blog01');

$db = new PDO("mysql:host=".DBHOST.";port=8889;dbname=".DBNAME, DBUSER, DBPASS);
$db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);

I tried all combinations of username and password (demo, admin...) without success.

Also tried without port=8889.

php version - 5.6.14

Any help.

Aucun commentaire:

Enregistrer un commentaire