15

我刚刚安装了最新版本的 MySQL。到目前为止,我在 Windows XP 上安装了它,但我想将它安装在另一台装有 Windows 7 的计算机上。

即使正确配置了所有内容,MySQL 客户端也不会显示在“开始”文件夹中。所以我去了 MySQL 的 bin 文件夹并尝试打开 mysql.exe 但它会立即关闭。

然后我尝试在 cmd 中打开 mysql.exe 这就是我得到的

C:\Program Files\MySQL\MySQL Server 5.5\bin>mysql
ERROR 1045 (28000): Access denied for user 'ODBC'@'localhost' (using password: N O)

有什么想法可以让这个工作吗?

4

4 回答 4

17

提供用户名(root) C:\Program Files\MySQL\MySQL Server 5.5\bin>mysql -uroot

默认密码为空白,但如果您设置它,您还需要提供密码

于 2010-12-22T10:56:03.463 回答
15

不记得第一次读到哪里了,但是之前遇到这个问题的时候,发现不得不手动开启一个服务:

  1. Windows 键+R 并键入运行并按“回车”
  2. 输入“services.msc”,点击“OK”
  3. 找到“MySQL56”,右键选择“开始”
  4. 您现在应该可以顺利登录了

这就是对我有用的解决方案;希望它可以帮助其他人。

于 2013-07-01T17:41:21.273 回答
1

@Herschel 所说的是正确的,如果您按照他的步骤 1-4 然后尝试在命令行中使用您的密码登录,您将没有任何问题。

您还可以使其作为服务自动运行,这是在服务器上运行时需要的。

  1. 打开运行
  2. 输入“services.msc”点击确定
  3. 查找 MySQL 服务
  4. 右键单击属性,然后转到启动类型:
  5. 将其更改为自动
于 2013-09-27T08:10:10.180 回答
0

我遵循了这些步骤,它对我有用:

1. Open Command prompt in admin and go to the location of Mysql bin folder and type -  
    C:\ProgramFile\mysql\bin>mysql -u root -p <password>
2. Then the prompt asks for the password. This is the password or the root user which 
    you had set during installation of mysql. 
3. Type the password and you will login in to mysql. 
4. Also make sure your mysql service is running in the backend by going to the 
   windows service panel and check whether the mysql service is running. 
于 2018-08-27T06:51:00.193 回答