PHP Database error

3

I uploaded my site (using filezilla) using php / mysql. In localhost it works perfectly but not on external server. The following error appears:

  

SQLSTATE [HY000] [1045] Access denied for user 'root' @ 'localhost

<?php

try {
    $pdo = new PDO ('mysql:host=localhost;dbname=***', '***', '***');
}
catch (PDOException $e) {
    exit('Database error.');
}
?>

What could be missing?

    
asked by anonymous 07.03.2014 / 18:29

2 answers

3

The message identifies that access was denied to user root in localhost .

This means that your host is correct, and you are getting to the bank, but he is not recognizing your bank and / or user and / or password as valid.

Check the provider for the correct MySQL access data and enter in the fields.

    
07.03.2014 / 19:53
1

Change the location of the bank, it should be as localhost, when you upload the application, have to change, and put the external link of the bank.

    
07.03.2014 / 18:35