开发者

MySQL command line won't open?

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 mys开发者_Python百科ql.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?


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:

  1. Windows key+R and type Run and hit "enter"
  2. Type "services.msc", hit "OK"
  3. Find "MySQL56", right-click and choose "Start"
  4. You should now be able to log in with no trouble

That's the solution that worked for me; hopefully it helps others out there.


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.

  1. Open Run
  2. Type "services.msc" click ok
  3. Find the MySQL service
  4. Right-click properties then go down to startup type:
  5. Change it to automatic


I followed these steps and it worked for me:

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. 


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:

  • MySql Version: 8.0
  • OS: Windows 10
  • OS Build: 19044.1586

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)

MySQL command line won't open?

After the installer had opened up I clicked on the "Reconfigure" action for MySQL Server

MySQL command line won't open?

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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜