Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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 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?

like image 681
Gaurav Avatar asked Dec 22 '10 10:12

Gaurav


3 Answers

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

like image 50
Mchl Avatar answered Oct 17 '22 00:10

Mchl


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.

like image 40
Herschel Avatar answered Oct 16 '22 23:10

Herschel


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
like image 31
Crouch Avatar answered Oct 16 '22 23:10

Crouch