Application Instantiation Error

robgratt
robgratt
Offline
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

Accepted Answer

Wednesday, March 08 2017, 08:33 AM - #Permalink
0
hello

but.. this is not music collection's issue.. is it?
this is your whole joomla installation that can't connect to the DB, isn't it?
The reply is currently minimized Show
Responses (1)
  • Accepted Answer

    robgratt
    robgratt
    Offline
    Wednesday, March 08 2017, 08:44 AM - #Permalink
    0
    Ahh! Very good point!

    I'll re-install Joomla! without any extensions and then see how I go.

    Sorry to have wasted your time...

    Rob
    The reply is currently minimized Show
Your Reply