MySQL 命令行打不开?
我刚刚安装了最新版本的 MySQL。到目前为止,我在 Windows XP 上安装了它,但我想将其安装在另一台装有 Windows 7 的计算机上。
即使正确配置所有内容后,MySQL 客户端也不会显示在“开始”文件夹中。所以我进入MySQL的bin文件夹并尝试打开mysql.exe,但它立即关闭。
然后我尝试在 cmd 中打开 mysql.exe这就是我得到的
C:\Program Files\MySQL\MySQL Server 5.5\bin>mysql
错误 1045 (28000):用户“ODBC”@“localhost”的访问被拒绝(使用密码:N O)
有什么想法可以让它发挥作用吗?
I just installed the latest version of MySQL. Until Now I had it on Windows XP but I wanted to install this on another computer with Windows 7.
Even after configuring everything correctly, the MySQL client won't show up in the Start Folder. So I went to the bin folder of MySQL and tried opening mysql.exe but it would immediately close down.
I then tried opening mysql.exe in cmd & this is what I get
C:\Program Files\MySQL\MySQL Server 5.5\bin>mysql
ERROR 1045 (28000): Access denied for user 'ODBC'@'localhost' (using password: N
O)
Any Ideas how I can get this to work?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
提供用户名(root)
C:\Program Files\MySQL\MySQL Server 5.5\bin>mysql -uroot
默认密码为空,但如果设置它,还需要提供密码
Provide username (root)
C:\Program Files\MySQL\MySQL Server 5.5\bin>mysql -uroot
Default passsword is blank, but if you set it, you will need to provde password as well
我不记得我第一次读到它是在哪里,但是之前遇到这个问题时,我发现我必须手动打开一个服务:
这就是对我有用的解决方案;希望它能帮助其他人。
I don't recall where I first read it, but when facing this problem before, I found that I had to manually turn on a service:
That's the solution that worked for me; hopefully it helps others out there.
@Herschel 所说的是正确的,如果您按照他的步骤 1-4 然后尝试在命令行中使用密码登录,您将不会遇到任何问题。
您还可以使其作为服务自动运行,这是在服务器上运行时所需要的。
What @Herschel said is right if you follow his steps 1-4 then try to log in with your password in command line you'll have no trouble.
You can also make this run automatically as a service, something which you need when running it on a server.
我按照以下步骤操作,它对我有用:
I followed these steps and it worked for me:
嘿嘿嘿嘿。因此,截至 2022 年 3 月 19 日,我遇到了同样的问题,但我会向您展示我是如何解决它的。开始之前我的规格:
好吧,我对 SQL 相当陌生,正在按照教程进行操作,但是当它到达打开客户端命令行的时候,它就不会了没有打开,它只是弹出并关闭;甚至没有要求密码。在观看了几个教程(非常没有帮助)之后,我从这些教程中注意到他们提供的解决方案是“激活 MYSQL80 服务”,但这对我没有帮助,因为我在服务菜单中看不到该服务。
所以我决定回到“MySql Installer -Community”应用程序(我安装了SQL的社区版本)
安装程序打开后,我单击了 MySQL 服务器的“重新配置”操作
< a href="https://i.sstatic.net/PTMvv.png" rel="nofollow noreferrer">
它打开了SQL Server的配置窗口,我按照配置过程设置了服务器(原来我在安装MySQL时最初并没有设置它
Heyoo Heyoo. So as of today 19th March 2022 I had this same issue but imma show you how I solved it. My specs before we start:
Alright, I'm fairly new to SQL, was following along with a tutorial but when it got to the point of opening the client command line it wouldn't open, it just popped up and closed back; didn't even ask for a password. After watching several tutorials (which were very unhelpful) I noticed from those tutorials that the solution they proffered was to "Active the MYSQL80 service", but that was unhelpful to me because I couldn't see that service in the services menu.
So I decided to go back to the "MySql Installer -Community" App (I installed the community version of SQL)
After the installer had opened up I clicked on the "Reconfigure" action for MySQL Server
It opened the configuration window for the SQL Server and I followed the configuration process to set up the server (turns out I didn't initially set it up when I installed MySQL ????????). After the configuration process was done I went back to the services menu to see if the "MYSQL80" service was there... and it was, I checked to see if it was running; following the instructions from this tutorial. After making sure the service was running I went back to the client command line, it finally opened up, allowed me to input my password, and it's working properly!!