#1045 - 用户 'root'@'localhost' 的访问被拒绝(使用密码:YES)

#1045 - Access denied for user #39;root#39;@#39;localhost#39; (using password: YES)(#1045 - 用户 root@localhost 的访问被拒绝(使用密码:YES))

本文介绍了#1045 - 用户 'root'@'localhost' 的访问被拒绝(使用密码:YES)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这似乎是多余的,但我无法找到正确的解决方案.

This might seem redundant but I was unable to find a correct solution.

我无法使用 mysql 控制台登录 mysql.它要求输入密码,但我不知道我实际输入了什么.(有没有办法获取密码或更改密码?)这是我的 config.inc 的样子.

I was unable to login to mysql using the mysql console.It is asking for a password and I have no clue what I actually entered.(Is there a way to get the password or change it?) This is how my config.inc look.

当我尝试打开 phpmyadmin 时出现此错误(#1045 - Access denied for user 'root'@'localhost'(使用密码:YES))

When I try to open phpmyadmin I get this error(#1045 - Access denied for user 'root'@'localhost' (using password: YES))

<?php

/* Servers configuration */
$i = 0;

/* Server: localhost [1] */
$i++;
$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'] = 'cookie';
$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['password'] = 'prakash123';
$cfg['Servers'][$i]['AllowNoPassword'] = true;

/* End of servers configuration */

$cfg['DefaultLang'] = 'en-utf-8';
$cfg['ServerDefault'] = 1;
$cfg['UploadDir'] = '';
$cfg['SaveDir'] = '';


/* rajk - for blobstreaming */
$cfg['Servers'][$i]['bs_garbage_threshold'] = 50;
$cfg['Servers'][$i]['bs_repository_threshold'] = '32M';
$cfg['Servers'][$i]['bs_temp_blob_timeout'] = 600;
$cfg['Servers'][$i]['bs_temp_log_threshold'] = '32M';


?>

我尝试卸载(加上删除所有相关文件)WAMP 并重新安装.它也没有帮助.在重新安装 WAMP 服务器时,它不会要求任何用户名密码,我不知道为什么.任何帮助表示高度赞赏.

I have tried to uninstall( Plus Deleted all the related files) WAMP and reinstall.It didn't help either. While reinstalling WAMP server it is not asking for any username password stuff I don't know why. Any help is highly appreciated.

推荐答案

问题是我安装了 2 个 Mysql 实例,但我不知道这两个实例的密码.只需检查端口 80 是否被任何一个程式.这就是我所做的

The problem was I have 2 instances of Mysql installed and I didn't know the password for both instances.Just check if port 80 is used by any of the programs. This is what I did

1.退出Skype,因为它正在使用端口80.(请检查端口80是否被任何其他程序使用).

1.Quit Skype because it was using port 80.(Please check if port 80 is used by any other program).

2.在任务管理器中搜索Mysql服务并停止.

2.Search for Mysql services in task manager and stop it.

3.现在删除所有相关的mysql文件.确保删除所有文件.

3.Now delete all the related mysql files.Make sure you delete all the files.

4.重新安装

这篇关于#1045 - 用户 'root'@'localhost' 的访问被拒绝(使用密码:YES)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本文标题为:#1045 - 用户 'root'@'localhost' 的访问被拒绝(使用密码:YES)

基础教程推荐