Hi,
I am setting up a WAMPserver locally and having issues connecting to the database.
I think that there is a problem with the user shanegib_schmid where in the above image it says NO under the Grant column. But I can’t see how to change this. Also the host is %, which I think is some kind of wildcard but it probably should be localhost.
the db.inc.php file is,
<?php
try
{
$pdo = new PDO('mysql:host=localhost; dbname=shanegib_arXiv', 'shanegib_schmid', 'password');
$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$pdo->exec('SET NAMES "utf8"');
$pdo->exec("SET time_zone='+01:00';");
}
catch (PDOException $e)
{
$error = 'Unable to connect to the database server.';
echo $e;
//include '/cuislegibney/admin/includes/error.html.php';
include $_SERVER['DOCUMENT_ROOT'] . '/cuislegibney/includes/error.html.php';
exit();
}
And the error on the webpage I get is,
exception 'PDOException' with message 'SQLSTATE[HY000] [1044] Access
denied for user 'shanegib_schmid'@'localhost' to database
'shanegib_arxiv'' in C:\wamp\www\cuislegibney\includes\db.inc.php:4
Stack trace:
#0 C:\wamp\www\cuislegibney\includes\db.inc.php(4):
PDO->__construct('mysql:host=loca...', 'shanegib_schmid',
'password')
#1 C:\wamp\www\cuislegibney\includes\access.inc.php(62):
include('C:\\wamp\\www\\cui...')
#2 C:\wamp\www\cuislegibney\includes\access.inc.php(21):
databaseContainsAuthor('shanegibney@gma...', 'hashed password...')
#3 C:\wamp\www\cuislegibney\index.php(4): userIsLoggedIn()
#4 {main}
Unable to connect to the database server.
My database is named shanegib_arXiv but coming up as shanegib_arxiv Is the upper case X relevant in the name?
Thanks,