0

I'm at my wits end trying to solve this issue. I can log into the root account (or any other account for that matter) just fine in PHPmyadmin. Howerver whenever I try to log in via the command line, I get the following error:

ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)

I've even tried creating a new user, making sure to specify its host as "localhost" and not "127.0.0.1" or "%" and it still doesn't work.

I don't even know where to begin at this point, as I've exhausted all the options from googling "Access denied for user 'root'@'localhost'".

Making a new user in phpmyadmin: adding a new user in phpmyadmin

Trying to log in with it on CLI: trying to log in with new user

Yet (and this is not something easily shown in a screenshot) I can log into phpmyadmin using that same username & password.

This is a production server that I inherited and it's been running just dandy for at least 4 years now, so I really can't tell you much about how it was setup. Also, some of the recommendations of uninstall/reinstall, stop, etc are simply not possible at this time.

My questions (I've seen other 'questions' closed for not stating this clearly):

  1. HELP! Why isn't this working? What am I doing wrong?
  2. I have a 500mb db that I need to import for a new project and even with some settings tweaks phpmyadmin is barfing all over it, so cli was the only other option I could think of. Is there some other possibility that I'm overlooking?

Some additional details:

  • This is on Windows server 2012 R2 SP1
  • Mysql version 5.1.66
  • Non-default port of 3307, I think.
Caleb
  • 57
  • 6
  • Tried to specify the port and hostname? `mysql -u test123 -p --host localhost --port 3307` – Roy Dec 18 '15 at 20:46
  • I have tried the -h switch before, but it doesn't respond at all. – Caleb Dec 18 '15 at 20:48
  • I was showing an example of making a new user and getting the same error. I presumed having root in the main error would get a few more eyeballs, since it didn't seem to make any difference which user was used. – Caleb Dec 18 '15 at 20:50

1 Answers1

2

Specify the port by adding -P3307 to your login string.

Redbeard011010
  • 943
  • 6
  • 20
  • OMFG you are a lifesaver. I had tried the -h switch and that didnt seem to make any difference. THANK YOU THANK YOU THANK YOU – Caleb Dec 18 '15 at 20:47