我的问题在下面:
C:\Users\ordek> mysql
ERROR 1045 (28000): Access denied for user 'ODBC'@'localhost' (using
password: NO)
C:\Users\ordek>mysql -u root
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using
password: NO)
C:\Users\ordek>mysql -u root -p
Enter password: ****
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using
password: YES)
在问这里之前,我尝试了很多解决方案。我什至尝试过重新安装MySQL,但令人惊讶的是,这个问题仍然存在。在Workbench中,我无法连接到任何连接。我总是以超级用户身份登录MySQL服务器,随后尝试更改特权的尝试均无效,因为我无法以通常的方式登录MySQL。
在Workbench中,无论哪个用户(无论是否是root),您都将收到此消息。
[Window Title]
MySQL Workbench
[Main Instruction]
Cannot Connect to Database Server
[Content]
Your connection attempt failed for user 'user1' to the MySQL server at
127.0.0.1:3306:
Access denied for user 'user1'@'localhost' (using password: YES)
Please:
1 Check that MySQL is running on address 127.0.0.1
2 Check that MySQL is reachable on port 3306 (note: 3306 is the default,
but this can be changed)
3 Check the user user1 has rights to connect to 127.0.0.1 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 127.0.0.1 connecting from the host address you're
connecting from
在“测试连接”(WORKBENCH)中,我总是收到此消息:
[Window Title]
MySQL Workbench
[Main Instruction]
Failed to Connect to MySQL at 127.0.0.1:3306 with user user1
[Content]
Access denied for user 'user1'@'localhost' (using password: YES)
在我看来,这是特权问题,但是我不知道该怎么做,因为我是MySQL的初学者。如果您知道如何解决此问题,请告诉我。
答案 0 :(得分:0)
我相信您使用.msi软件包安装了MySQL(windows)。 .msi允许您逐步进行安装,并且可以设置“ root”密码。
如果您具有root密码,请确保已启动MySQL服务。
控制面板>服务> Mysql
答案 1 :(得分:0)
mysql未知用户 ordek 。切换到root用户,它将起作用。 如果不可能,或者根密码未知,请重新安装mysql,记下根密码以备将来使用,创建 ordek 用户并为其分配所需的访问权限。 / p>