Quantcast
Channel: WampServer - WampServer English
Viewing all articles
Browse latest Browse all 3177

mysql [1045] Access denied for user 'root'@'localhost' (using password: YES) (no replies)

$
0
0
I can access phpadmin to databases but don't can get access from website witch i building send me this message error.

Connection failed: SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: YES)

i tried different ways to get over but don't get that

how i can solve this problem.

here is my login script.

<?php
define('servername', 'localhost');
define('username' , 'root');
define('password', 'sarf1965');
define('dbname' , 'sandoval_store');

try {
$conn = new PDO("mysql:host=". servername .";dbname=".dbname , username, password);
// 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();
}
?>

thanks i appreciate any help.

Fernando Sandoval

Viewing all articles
Browse latest Browse all 3177

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>