Debug School

rakesh kumar
rakesh kumar

Posted on • Edited on

1045 - Access denied for user 'root'@'localhost' (using password: No)

Error – phpMyAdmin tried to connect to the MySQL server, and the server rejected the connection. You should check the host, username and password in your configuration and make sure that they correspond to the information given by the administrator of the MySQL server.

SOLUTION

/opt/lampp/phpmyadmin
Enter fullscreen mode Exit fullscreen mode
vi config.inc.php
Enter fullscreen mode Exit fullscreen mode
head -n 40 config.inc.php | tail -n 15 
Enter fullscreen mode Exit fullscreen mode

fistway

/* Authentication type */
$cfg['Servers'][$i]['auth_type'] = 'cookie';
$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['password'] = 'Hsgjdk3768yuik';
/* Server parameters */
//$cfg['Servers'][$i]['host'] = 'localhost';
$cfg['Servers'][$i]['compress'] = false;
$cfg['Servers'][$i]['AllowNoPassword'] = true;
Enter fullscreen mode Exit fullscreen mode
$cfg['Servers'][$i]['auth_type'] = 'config';
$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['password'] = 'moto 123';
$cfg['Servers'][$i]['host'] = 'localhost';
$cfg['Servers'][$i]['compress'] = false;
$cfg['Servers'][$i]['AllowNoPassword'] = false;
Enter fullscreen mode Exit fullscreen mode

or

ALTER USER 'root'@'localhost' IDENTIFIED BY 'your_new_password';
FLUSH PRIVILEGES;
Enter fullscreen mode Exit fullscreen mode

Top comments (0)