8

Can anyone tell me why I got an alert with the access denied error? I tried to create a mysql database and I confidently sure I entered the correct password for root yet I still got this error.

However, based on the mysql documentation for troubleshooting, my error specified that I did not enter the correct password which in fact I did not.

Mysql documentation

https://dev.mysql.com/doc/refman/5.5/en/problems-connecting.html

Also , I tried to run this command sudo mysql -u root -pand it also show me the same error.

Here is the error

P.S Because my reputation is too low, I can't attach the full image.

JNevill
  • 46,980
  • 4
  • 38
  • 63
Wolver Ing
  • 81
  • 1
  • 1
  • 5

6 Answers6

5

might be check you are currently connect with the correct password plugin, use the following Command, SELECT user, authentication_string, plugin, host FROM mysql.user; enter image description here

If your are login with root, check whether plugin is "mysql_native_password" if not, change as it is with the following command.

ALTER USER 'root'@'localhost IDENTIFIED WITH mysql_native_password BY 'Password@123'

Eranda J.
  • 490
  • 5
  • 7
1

You may get this error when your mysqld is configured to accept connection only from localhost.

In such case, you need to modify bind-address property in /etc/mysql/mysql.conf.d/mysqld.cnf. You can allow only your ip or from the whole internet(0.0.0.0).

Make sure to restart the mysql server.

sudo systemctl restart mysql.

That's not it. You also need to allow connection on port 3306 using commands like ufw or iptables.

Krishna
  • 6,107
  • 2
  • 40
  • 43
1

I had this problem on Beekeeper and DBeaver. It was driving me INSANE. I literally copied the password and was testing the connections manually and it was working perfectly. Annoyingly this server was working perfectly with MySQL workbench on Windows before I migrated over to Fedora.

So I needed to set the "SSH" section so that it would log me in to the other device. That test connection worked perfectly. But STILL no success. "Password failure" an incredibly inaccurate error message...

Turns out after enabling the SSH connection I forgot to change the "Server host" variable from it's IP (192...) to 'localhost'. Now it works perfectly.

Michael
  • 84
  • 4
1

For anyone struggling with SSH tunnel. I found that sometimes 127.0.0.1 is not being translated back to localhost before privileges are being check.

Try setting up a grant for 127.0.0.1 with the following.

GRANT ALL PRIVILEGES ON *.* TO 'user'@`127.0.0.1`;

This did the trick for me.

Rager
  • 746
  • 4
  • 25
0

enter image description here

Please enter these configurations in connection window

Community
  • 1
  • 1
user2015398
  • 536
  • 4
  • 10
0

It Could be various things try this:

  1. In main configuration username="root" password="YOUR_PASSWORD" As in no need to put the actual password, only copy "YOUR_PASSWORD"

  2. If it still doesn´t work leave the database bank

  3. Check that your IP address is added to the server permissions/security

  4. Check that the DB is available and that public connection is allowed

  5. If using Windows allow connections to the port 3306 on the Firewall Defender(control panel, security, firewall defender, advanced setting, add inbound rule, port, 3306, allow)

Rohit Gupta
  • 4,022
  • 20
  • 31
  • 41
Pilar Rius
  • 13
  • 3