无法连接到mysql在127.0.0.1:3306用户root访问拒绝用户'root'@'localhost'(使用密码:是) [英] Failed to connect to mysql at 127.0.0.1:3306 with user root access denied for user 'root'@'localhost'(using password:YES)

查看:2506
本文介绍了无法连接到mysql在127.0.0.1:3306用户root访问拒绝用户'root'@'localhost'(使用密码:是)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在尝试在工作台上创建一个新的数据库连接。但是,每次测试连接时,都会显示一条错误消息,表示

I've been trying to create a new database connection on workbench. However, every time I test a connection there is an error message that says


无法连接到mysql的127.0.0.1:3306根用户访问被拒绝为用户'root'@'localhost'(使用密码:是)

Failed to connect to mysql at 127.0.0.1:3306 with user root access denied for user 'root'@'localhost'(using password:YES)

我不知道是什么原因这个错误。我已经尝试卸载并重新安装我的工作台6.1和mysql服务器5.6,但错误仍然未解决。

I don't know what's the cause of this error. I have tried uninstalling and re-installing my workbench 6.1 and mysql server 5.6 but the error is still unsolved.

推荐答案

这是一个工作台或连接问题。

First check if it's a workbench or connection problem.

1)在您的窗口运行'cmd'打开终端

1) In your windows run 'cmd' to open a terminal

试试两个


2a)mysql -u root -p -h 127.0.0.1 -P 3306
2b)mysql - u root -p -h
localhost -P 3306

2a) mysql -u root -p -h 127.0.0.1 -P 3306
2b) mysql -u root -p -h localhost -P 3306

3)如果连接良好,

3) If the connection is good you will get a password prompt, see if you can connect with correct password.

如果您的连接被拒绝,只需授予

If your connection is denied, just grant the permission

mysql >GRANT ALL ON [DatabaseName].* TO 'root'@'127.0.0.1' IDENTIFIED BY '[PASSWORD]';

如果您的连接在这里被接受,就像一个工作台配置问题。

If your connection is accepted here, it's like a workbench configuration problem.

这篇关于无法连接到mysql在127.0.0.1:3306用户root访问拒绝用户'root'@'localhost'(使用密码:是)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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