Access denied for user 'root'@'localhost' with PHPMyAdmin
When I set the root password in PHPMyAdmin, I get this error:
#1045 - Access denied for user 'root'@'localhost' (using password: NO)
I can't open the PHPMyAdmin panel. What am I doing wrong?
编辑你的phpmyadmin config.inc.php文件,如果你有密码,在密码前插入以下代码:
$cfg['Servers'][$i]['verbose'] = 'localhost';
$cfg['Servers'][$i]['host'] = 'localhost';
$cfg['Servers'][$i]['port'] = '3306';
$cfg['Servers'][$i]['socket'] = '';
$cfg['Servers'][$i]['connect_type'] = 'tcp';
$cfg['Servers'][$i]['extension'] = 'mysqli';
$cfg['Servers'][$i]['auth_type'] = 'config';
$cfg['Servers'][$i]['user'] = '**your-root-username**';
$cfg['Servers'][$i]['password'] = '**root-password**';
$cfg['Servers'][$i]['AllowNoPassword'] = true;
Here are few steps that must be followed carefully
Create a folder named config inside C:wampappsphpmyadmin, the folder inside apps may have different name like phpmyadmin3.2.0.1
Return to your browser in phpmyadmin setup tab, and click New server.
Change the authentication type to 'cookie' and leave the username and password field empty but if you change the authentication type to 'config' enter the password for username root.
Click save
上一篇: 警告:除以零