I'm working on Debian 8 and wanted to create database using MySQL Workbench. I did everything in this tutorial, but when I created a new MySQL Connection, the program returned:

Failed to Connect to MySQL at with user root, Access denied for user 'root'@'localhost' (using password: YES).

What am I doing wrong? I typed the correct password.

  • 1
    Can you test login in the command line: mysql -u root -p then your password? – oNare Jul 10 '15 at 13:20
  • Always test with the command line tool before blaming mysqld or MySQL Workbench. – Vérace Jul 10 '15 at 15:29
  • Also, does ping work? – Vérace Jul 10 '15 at 15:58

Since you get an "access denied" the actual connection to the server worked. You just have used a user that is not allowed to connect either because it connects from a machine that is not enabled in the user settings and/or the user does not exist or the password is wrong.

  • Is it the correct server you connected to?
  • Are you 100% sure to have used the right user/pw?
  • Is the IP address of the user allowed to connect at all?

Access Denied while connecting to the database happens only when you are using wrong password. Quick check here -> MySQL installer will not provide an option for My SQL server installation if you have configured you MySQL server before on your system for eg. with phpadmin , though it will ask you to create a password for the server. This password hold false while logging into MySQL workbench. It will not override the password used before. Hence try using the old password rather than newly created password.


Check for root user in mysql first. Set the password during first login and check if port and ip is added in /etc/my.cnf file. Hash the bind address and try again.


As mentioned in comment

  1. Try to ping the server
  2. If you have another MySQL client/server try this:

    mysql -h XXX.XXX.X.XX(your IP) -u root -p

  3. Check privileges for root user; you can always do this



  4. If you are using firewall, check iptables

These are possible solutions which solve my problem most of the time.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.