Anthony
Anthony

Reputation: 4050

MySQL Password Not Working

EDIT: I had MySQL installed twice on my machine (XAMPP & on its own)

When I enter my password into MySQL Command Line Client, it rejects my password, gives 1 beep and closes the window. Can anyone provide me with a basic troubleshooting list of steps (from simple to progressively more technical) to regain entry into MySQL once and for all. Also, can anyone tell me what can cause my password to suddenly be rejected? I am also running XAMPP and the MySQL service is both installed and running. Thanks in advance.

I remember when I first got this problem some months ago, if I recall correctly, I solved it by starting the MySQL service from Windows XP's Administrative Tool (something I did stopped the MySQL service and to this day I don't know what it was).

Now the problem has started back again but this time, when I checked Services, the MySQL service was already 'started'.

Any assistance will be appreciated. Thanks

Upvotes: 16

Views: 66409

Answers (9)

James
James

Reputation: 12806

Do you have the password for the root account? If so, try this from the command line?

mysql --user=root --password=your password here

or

mysql --user=root --password=your password here --database=MySQL

Upvotes: 2

Sxit
Sxit

Reputation: 11

How to Reset the Root Password | MySQL

This is the services solution that was mentioned. Use this if you can't remember your root password.

Upvotes: 1

Anthony
Anthony

Reputation: 4050

My password suddenly worked again, so I took the following steps to change it:

  1. Using Windows Command Prompt, navigate to MySQL's bin directory
  2. Type: mysqladmin -uroot -p password yourNewPassword
  3. Press Enter. You will be prompted for your password, enter it
  4. If no error messages/beeps happen, your password was successfully changed
  5. Log in using MySQL Command Prompt with your new password

What I don't understand is that WHY all of a sudden my password started back to work after approximately 24 hours? I wish I know so I can avoid this in the future.

Upvotes: 0

inteblio
inteblio

Reputation: 113

For me (and my similar problem),

--password = mypass

didn't work, but

--password="mypass"

did.

Upvotes: 3

austinthemassive
austinthemassive

Reputation: 6625

If you set mySQL to not begin running on startup, then you need to start it prior to attempting to login. This can be done via the command line, via the task manager if you configured it as a windows service, etc.

For example, here is an explanation of starting the service using cmd

Starting MySQL from the Windows Command Line | MySQL

Upvotes: 2

Anton Smith
Anton Smith

Reputation: 1399

A bit too late but - If you have numeric characters in your password and are using the numpad on your keyboard, ensure that the numlock is ON. For some weird reason if you have numlock off MySQL will still interpret a keystroke. This wasn't very obvious to me since my laptop doesn't have a num lock indicator light, thats HP for yah :)

Upvotes: 1

Dale
Dale

Reputation: 1301

I'd like to add another successful solution to this problem. I reran the installer (the msi), chose the repair option and everything was fixed.

Upvotes: 0

Anthony
Anthony

Reputation: 4050

I think I figured out why my password was not working. I had two versions of MySQL installed on my machine (XAMPP and MySQL 5.1). So I deleted the MySQL 5.1 and it worked.

Upvotes: 4

Eli
Eli

Reputation: 5620

Is there an error message when it rejects your password? I wonder if perhaps you are using an outdated client and running into this issue: http://dev.mysql.com/doc/refman/5.1/en/old-client.html

Upvotes: 2

Related Questions