简体   繁体   中英

My site is hacked, error MYSQL Access denied for user 'user'@'localhost' (using password: YES)

My website and every other website i hosted with one hosting service was hacked yesterday. Other site from other host is still intact. I was logged on when it happened, so I was able to recover my site but, the phpMyAdmin has been tampered with. I created a new database after the old one failed to connect, created a new user for it, and granted all privileges. But when I enter the phpmyadmin page, I run the following queries;

 SELECT USER(),CURRENT_USER();

RESULT;
USER() CURRENT_USER() cpaneluserid@localhost cpaneluserid@localhost

 SELECT user,host,password FROM mysql.user;

RESULT;

1142 - SELECT command denied to user 'cpaneluserid'@'localhost' for table 'user'

 SELECT user,host,password FROM mysql.user WHERE user='' AND host='localhost';

RESULT;

1142 - SELECT command denied to user 'cpaneluserid'@'localhost' for table 'user'

Well this clearly shows that another user, which is the cpanel username is having access to the database instead of the one I set privilege for.

This is my connection file;

error_reporting(E_ERROR);
session_start();

$dbserver = "localhost";
$dbroot = "user";
$dbpwd = "xxxxxxxxxx";
$dbname = "dbname";
$link = mysqli_connect("$dbserver", "$dbroot", "$dbpwd","$dbname"); 

if(mysqli_connect_errno($link))
{
echo 'Failed to connect to database: '.mysqli_connect_error();
}else { }

When I open a page that contains that file, it shows; Access denied for user 'user'@'localhost' (using password: YES).

Please I need to resolve this quickly. Thanks in advance.

用户没有权限或没有适当的特权,请提供对该用户的完全访问权限。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM