使用 PHPMyAdmin 拒绝用户“root"@“localhost"的访问 [英] Access denied for user 'root'@'localhost' with PHPMyAdmin

查看:30
本文介绍了使用 PHPMyAdmin 拒绝用户“root"@“localhost"的访问的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我在 PHPMyAdmin 中设置 root 密码时,出现此错误:

When I set the root password in PHPMyAdmin, I get this error:

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

我无法打开 PHPMyAdmin 面板.我做错了什么?

I can't open the PHPMyAdmin panel. What am I doing wrong?

推荐答案

编辑您的 phpmyadmin config.inc.php 文件,如果您有密码,请在以下代码中将其插入密码前:

Edit your phpmyadmin config.inc.php file and if you have Password, insert that in front of Password in following code:

$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;

这篇关于使用 PHPMyAdmin 拒绝用户“root"@“localhost"的访问的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆