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:
None 
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
Description:
----[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 127.0.0.1:3306 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
environment.

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

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
Success.

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
environment.

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

 - Removing privileges on test database...
Success.

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
Success.

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
owners.

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

mysql> SELECT VERSION();
+-----------+
| VERSION() |
+-----------+
| 8.0.26    |
+-----------+
1 row in set (0.00 sec)

mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.00 sec)

mysql> EXIT
Bye

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.

Regards,
Ashwini Patil