0
votes

Solved after restart

I was trying to connect to localhost on mysql workbench and got this message:

Your connection attempt failed for user 'root' to the MySQL server at localhost:3306: Unable to connect to localhost:3306

Please: 1 Check that MySQL is running on address localhost 2 Check that MySQL is reachable on port 3306 (note: 3306 is the default, but this can be changed) 3 Check the user root has rights to connect to localhost from your address (MySQL rights define what clients can connect to the server and from which machines) 4 Make sure you are both providing a password if needed and using the correct password for localhost connecting from the host address you're connecting from

However, when I tried on terminal, the connection was successful:

$ mysql -u root -p -h localhost -P 3306
Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 13
Server version: 8.0.19 MySQL Community Server - GPL

Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> quit

Was there a problem of my workbench configuration or something?

1
try to login with user "root@localhost" or "[email protected]" - Romeo Ninov
Connecting as root from the server shell will always work. From the output, it seems you tried to connect from the server shell. Are you trying to connect your Workbench from the server itself or from another machine? - aLuViAn
Which MySQL Workbench version do you use to connect? Always use the latest one (same version number as that of the server). - Mike Lischke

1 Answers

0
votes

You can try an ip adresse 127.0.0.1.