@KizaHere

How to setup mysql on ubuntu for ssh access

CREATE USER '{{username}}'@'localhost' IDENTIFIED BY '{{password}}';

CREATE USER '{{username}}'@'%' IDENTIFIED BY '{{password}}';

GRANT ALL ON *.* TO '{{username}}'@'localhost';

GRANT ALL ON *.* TO '{{username}}'@'%';

FLUSH PRIVILEGES;

Ensure to set the host to

127.0.0.1
instead of localhost in the config.

Source: Add user for remote access

Also keep in mind:

mysql
lib doesn't support default mysql auth method . As a result I've switched to mysql2