Hi folks,
i am facing a strange problem.
Access denied for user 'john'@'localhost' (using password: NO)
myproblem is, there are no user such as john at all in our company. i checked all my scripts and found no ware it is mentioned as john, then checked cpanel mysql databases and list of users. no ware john is mentioned.
who the heck is this john, i am banging head…
We are hosted our website on justhost. To make sure we are not connecting to any other local web servers in the company, i have even removed the local area cable.
Connection Script
/*** mysql hostname ***/
$hostname = 'localhost';
/*** mysql username ***/
$username = 'xxxco';
/*** mysql password ***/
$password = '123456';
try {
$db = new PDO("mysql:host=$hostname;dbname=xxxco_visa", $username, $password);
/*** echo a message saying we have connected ***/
//echo 'Connected to database';
// Throw exceptions on errors
$db->setAttribute(PDO::ATTR_ERRMODE,PDO::ERRMODE_EXCEPTION);
// Use assoc arrays by default
$db->setAttribute(PDO::ATTR_DEFAULT_FETCH_MODE,PDO::FETCH_ASSOC);
array(PDO::MYSQL_ATTR_INIT_COMMAND => 'SET time_zone = \'+03:00\'') ;
}catch(PDOException $e){
echo $e->getMessage();
}
?>
Server information
*> Server: Localhost via UNIX socket
Software: Percona ServerSoftware version: 5.5.40-36.1-log - Percona Server (GPL), Release 36.1, Revision 707Protocol version: 10
User: xxxco@localhost
Server charset: UTF-8 Unicode (utf8)*
Also if i rung the connection script directly then no any error. just blank. mean ok.