Wamp phpMyAdmin error #1045 - Access denied for user #39;root#39;@#39;localhost#39;(Wamp phpMyAdmin 错误 #1045 - 用户 root@localhost 拒绝访问)
问题描述
这是一个很常见的问题,我找到了很多教程来帮助我解决它,但我的案例还有一个问题......
This is quite common problem and I found a lot of tutorials to help me solve it, although, there is one additional problem with my case...
这是我在 config.inc.php 中的配置设置
This is my config settings in config.inc.php
$cfg['Servers'][$i]['verbose'] = 'localhost';
$cfg['Servers'][$i]['host'] = 'localhost';
$cfg['Servers'][$i]['port'] = '';
$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'] = 'root';
$cfg['Servers'][$i]['password'] = 'root';
$cfg['Servers'][$i]['AllowNoPassword'] = true;
$cfg['Servers'][$i]['AllowNoPasswordRoot'] = true;
当我尝试通过 wamp 主页登录时,错误显示:
When I try to log in via wamp main page, the error shows:
当我尝试通过 CONSOLE 访问 MyAdmin 时也是如此!
AND this same is when I try to acces MyAdmin by CONSOLE!
无论我输入什么密码或按回车键,它都会向我显示同样的错误,因此我无法刷新特权".
No matter what I type as password or just press enter, it shows me this same error, and because of that i cant 'flush priviliges'.
我能做什么?
推荐答案
步骤 1:打开 MySQL 控制台.
第 2 步:输入提供的命令行
$使用mysql;
$UPDATE mysql.user SET password="PASSWORD("YourPassword") WHERE user="root";
$刷新权限;
$exit;
第 3 步:打开并编辑位于本地服务器文件中的 config.inc.php 文件
- 转到我的电脑 > C 盘 >(您的本地服务器文件夹,WAMP/MAMP/XAMPP) > 应用程序 > PHPMYADMIN > config.inc.php
- 使用文本编辑器(例如 Notepad++)打开您的 config.inc.php 文件.
- 找到这行代码:$cfg['Servers'][$i]['password'] = '';//MySQL 密码
- 更改 ['密码'] = '';--to--> ['密码'] = '你的密码';使用您在第 2 步中创建的新密码.
- 点击保存
第 4 步:转到 phpmyadmin转到 http://localhost/phpMyAdmin/
.
这篇关于Wamp phpMyAdmin 错误 #1045 - 用户 'root'@'localhost' 拒绝访问的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:Wamp phpMyAdmin 错误 #1045 - 用户 'root'@'localhost' 拒绝访问


基础教程推荐
- 使用 VBS 和注册表来确定安装了哪个版本和 32 位 2021-01-01
- 带有WHERE子句的LAG()函数 2022-01-01
- 带更新的 sqlite CTE 2022-01-01
- MySQL根据从其他列分组的值,对两列之间的值进行求和 2022-01-01
- 如何在 CakePHP 3 中实现 INSERT ON DUPLICATE KEY UPDATE aka upsert? 2021-01-01
- MySQL 5.7参照时间戳生成日期列 2022-01-01
- ORA-01830:日期格式图片在转换整个输入字符串之前结束/选择日期查询的总和 2021-01-01
- 从字符串 TSQL 中获取数字 2021-01-01
- while 在触发器内循环以遍历 sql 中表的所有列 2022-01-01
- CHECKSUM 和 CHECKSUM_AGG:算法是什么? 2021-01-01