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

请问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日

悬赏问题

  • ¥170 如图所示配置eNSP
  • ¥20 docker里部署springboot项目,访问不到扬声器
  • ¥15 netty整合springboot之后自动重连失效
  • ¥15 悬赏!微信开发者工具报错,求帮改
  • ¥20 wireshark抓不到vlan
  • ¥20 关于#stm32#的问题:需要指导自动酸碱滴定仪的原理图程序代码及仿真
  • ¥20 设计一款异域新娘的视频相亲软件需要哪些技术支持
  • ¥15 stata安慰剂检验作图但是真实值不出现在图上
  • ¥15 c程序不知道为什么得不到结果
  • ¥15 键盘指令混乱情况下的启动盘系统重装