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}}'@'%';


Ensure to set the host to
instead of localhost in the config.

Source: Add user for remote access

Also keep in mind:

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