2

I recently installed mysql server and client, but I can't connect to the server. I get this message:

Access denied for user 'root'@'localhost' (using password: YES/NO)

Whatever I do i will always get the same message.

I tried commenting bind-address but still the same thing.

2
  • How are you trying to connect? Commented Oct 7, 2011 at 15:24
  • I tried both terminal and GUI programs, in ubuntu. I mean no matter what i do, even if it to change the password i will always get the "access denied" Commented Oct 7, 2011 at 15:25

1 Answer 1

3

If you set up a password for the root user during installation, then start the mysql client with the -p option, mysql -u root -p, and it should prompt you for a password.

If there's no password set, leave the -p off and it should log right in.

If you've somehow forgotten what the root password is, you can fix it by following these instructions... http://dev.mysql.com/doc/refman/5.0/en/resetting-permissions.html

Sign up to request clarification or add additional context in comments.

4 Comments

I tried that many times, there is a password and i remember it, with or without -p it will give the error 1040, accessed denied..
Scratch that, error 1040 is not a password error. It's a too-many-connections error: rackerhacker.com/2008/06/24/…
Resetting the system password? No i haven't done that, i'll try now, though i can see why would that be a problem.
Oh, sry i meant error 1045! "ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO) "

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.