0
Hi,
I'm trying to get Music Collection working with XAMPP running on Win 10.
I've got it working on my live site, but get the error: Error displaying the error page: Application Instantiation Error: Could not connect to MySQL.
I've used the following code to test locally:
$servername = "localhost";
$username = "username"; // not the actual username and password.
$password = "password";
try {
$conn = new PDO("mysql:host=$servername;dbname=dbname", $username, $password); // not the actual dbname
// set the PDO error mode to exception
$conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
echo "Connected successfully";
}
catch(PDOException $e)
{
echo "Connection failed: " . $e->getMessage();
}
?>
and it connects ok.
These are the credential in the configuration.php in the root directory. Do I have to set them somewhere else, also?
Tried debugging in Netbeans, but can't get it to build so have to step through line by line - but I always seem to miss where the error is raised! Where is it raised?
Sorry - long post but I'm a bit stuck!
Thanks, Rob
I'm trying to get Music Collection working with XAMPP running on Win 10.
I've got it working on my live site, but get the error: Error displaying the error page: Application Instantiation Error: Could not connect to MySQL.
I've used the following code to test locally:
$servername = "localhost";
$username = "username"; // not the actual username and password.
$password = "password";
try {
$conn = new PDO("mysql:host=$servername;dbname=dbname", $username, $password); // not the actual dbname
// set the PDO error mode to exception
$conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
echo "Connected successfully";
}
catch(PDOException $e)
{
echo "Connection failed: " . $e->getMessage();
}
?>
and it connects ok.
These are the credential in the configuration.php in the root directory. Do I have to set them somewhere else, also?
Tried debugging in Netbeans, but can't get it to build so have to step through line by line - but I always seem to miss where the error is raised! Where is it raised?
Sorry - long post but I'm a bit stuck!
Thanks, Rob
Your Reply

Please login to post a reply
You will need to be logged in to be able to post a reply. Login using the form on the right or register an account if you are new here.
Register Here »