Bug #104931 Cannot connect through Workbench to localhost with user root and password
Submitted: 13 Sep 2021 22:24 Modified: 16 Sep 2021 13:29
Reporter: Gabe Flores Email Updates:
Status: Can't repeat Impact on me:
Category:MySQL Workbench Severity:S7 (Test Cases)
Version:8.0.26 OS:Linux (Ubuntu 21.04 x86_64)
Assigned to: CPU Architecture:Any
Tags: WBBugReporter

[13 Sep 2021 22:24] Gabe Flores
----[For better reports, please attach the log file after submitting. You can find it in /home/gabe/.mysql/workbench/log/wb.log]
I performed the following part of the installation and restarted MySQL server. I then tried to test my connection to localhost through MySQL Workbench with user Root and the password I just created. When I select Test Connection I receive 'Failed to Connect to MySQL at with user root'. I am currently running OS Ubuntu 21.04

gabe@gabes-machine:~$ sudo mysql_secure_installation
[sudo] password for gabe: 

Securing the MySQL server deployment.

Enter password for user root: 
The 'validate_password' component is installed on the server.
The subsequent steps will run with the existing configuration
of the component.
Using existing password for root.

Estimated strength of the password: 100 
Change the password for root ? ((Press y|Y for Yes, any other key for No) : y

New password: 

Re-enter new password: 

Estimated strength of the password: 100 
Do you wish to continue with the password provided?(Press y|Y for Yes, any other key for No) : y
By default, a MySQL installation has an anonymous user,
allowing anyone to log into MySQL without having to have
a user account created for them. This is intended only for
testing, and to make the installation go a bit smoother.
You should remove them before moving into a production

Remove anonymous users? (Press y|Y for Yes, any other key for No) : y

Normally, root should only be allowed to connect from
'localhost'. This ensures that someone cannot guess at
the root password from the network.

Disallow root login remotely? (Press y|Y for Yes, any other key for No) : y

By default, MySQL comes with a database named 'test' that
anyone can access. This is also intended only for testing,
and should be removed before moving into a production

Remove test database and access to it? (Press y|Y for Yes, any other key for No) : y
 - Dropping test database...

 - Removing privileges on test database...

Reloading the privilege tables will ensure that all changes
made so far will take effect immediately.

Reload privilege tables now? (Press y|Y for Yes, any other key for No) : y

All done! 
gabe@gabes-machine:~$ mysql -u root -p
Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 12
Server version: 8.0.26 MySQL Community Server - GPL

Copyright (c) 2000, 2021, Oracle and/or its affiliates.

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

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

| 8.0.26    |
1 row in set (0.00 sec)

Query OK, 0 rows affected (0.00 sec)

mysql> EXIT

How to repeat:
- Start mySql server from terminal with: $sudo systemctl start mysql
- Launch mySQL Workbench
- Select localhost connection
- Select from Database dropdown -> Manage Connections
- Select localhost
- Username root and enter password by selecting 'Store in Keychain...'
- Select -> Test Connection
- Error is produced
[16 Sep 2021 13:29] MySQL Verification Team
Hello Gabe Flores,

Thank you for the bug report.
I tried to reproduce your issue on Ubuntu with MySQL workbench 8.0.26 but I am not seeing any issues at my end.

Ashwini Patil