AVTDF 2022-04-10 09:25 采纳率: 64.7%
浏览 1030
已结题

请问MySQL数据库拒绝访问是什么情况?

以管理员身份运行的命令提示符界面代码:

(c) Microsoft Corporation。保留所有权利。

C:\Windows\system32>net start mysql57
请求的服务已经启动。

请键入 NET HELPMSG 2182 以获得更多的帮助。

C:\Windows\system32>mysql -h localhost -u root -p
Enter password:
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)

C:\Windows\system32>mysql -h localhost -u root -p

MySQL Workbench错误提示界面:

[Window Title]
MySQL Workbench

[Main Instruction]
Cannot Connect to Database Server

[Content]
Your connection attempt failed for user 'root' to the MySQL server at localhost:3306:
Access denied for user 'root'@'localhost' (using password: YES)

Please:
1 Check that MySQL is running on address localhost
2 Check that MySQL is reachable on port 3306 (note: 3306 is the default, but this can be changed)
3 Check the user root has rights to connect to localhost from your address (MySQL rights define what clients can connect to the server and from which machines)
4 Make sure you are both providing a password if needed and using the correct password for localhost connecting from the host address you're connecting from

[Close]

  • 写回答

3条回答 默认 最新

  • 无极低码 2022-04-10 09:59
    关注

    根据描述很可能是用户授权问题,看一下localhost对应的账号和密码,如果都正确,就要查看是否有localhost访问权限了,一般默认是有的,如果有人改了授权,指定了某个ip能访问,那就无法访问了,需要管理员进行授权,如果是远程访问也需要授权。具体得看报错的错误码,比如10038

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?

问题事件

  • 系统已结题 4月18日
  • 已采纳回答 4月10日
  • 修改了问题 4月10日
  • 创建了问题 4月10日

悬赏问题

  • ¥15 完成下列问题完成下列问题
  • ¥15 C#算法问题, 不知道怎么处理这个数据的转换
  • ¥15 YoloV5 第三方库的版本对照问题
  • ¥15 请完成下列相关问题!
  • ¥15 drone 推送镜像时候 purge: true 推送完毕后没有删除对应的镜像,手动拷贝到服务器执行结果正确在样才能让指令自动执行成功删除对应镜像,如何解决?
  • ¥15 求daily translation(DT)偏差订正方法的代码
  • ¥15 js调用html页面需要隐藏某个按钮
  • ¥15 ads仿真结果在圆图上是怎么读数的
  • ¥20 Cotex M3的调试和程序执行方式是什么样的?
  • ¥20 java项目连接sqlserver时报ssl相关错误