'dbeaver mysql connection refused in ubuntu 20.04

I am not able to connect to mysql from dbeaver in ubuntu 20.04, I am adding the error screenshot.

mysql is ruuning on machine on the below ports

mysqld    5846           mysql   22u  IPv4 122911      0t0  TCP 127.0.0.1:33060 (LISTEN)
mysqld    5846           mysql   24u  IPv4 120996      0t0  TCP 127.0.0.1:3306 (LISTEN)

Any help will be greatly appreciated.

when i try connection on port 3306 i get below error

enter image description here

when i try connecting on 33060

enter image description here



Solution 1:[1]

What worked for me:

CREATE USER 'username'@'%' IDENTIFIED BY 'Password123#@!';
GRANT ALL PRIVILEGES ON *.* TO 'username'@'%' WITH GRANT OPTION;

I was also facing "ERROR 1819 (HY000): Your password does not satisfy the current policy requirements" running the first query This is because my password policy was set to "MEDIUM". If you face same you can check using

SHOW VARIABLES LIKE 'validate_password%';

rest of the configuration i am attaching screenshot for it:

enter image description here

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 souradeep majumdar