How to resolve the error - failed to connect to mysql at 127.0.0.1 with user root?

752    Asked by ClareMatthews in SQL Server , Asked on Mar 16, 2023

I'm working on Debian 8 and wanted to create a 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 127.0.0.1:3306 with user root, Access denied for user 'root'@'localhost' (using password: YES).

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

Answered by David Edmunds

To resolve the error - failed to connect to mysql at 127.0.0.1 with user root-Try to ping the server

 If you have another MySQL client/server try this:
mysql -h XXX.XXX.X.XX(your IP) -u root -p
Check privileges for root user; you can always do this
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'yourpass' WITH GRANT OPTION;
FLUSH PRIVILEGES;
If you are using firewall, check iptables
These are possible solutions which solve my problem most of the time.

Your Answer

Interviews

Parent Categories