Security is on top of the list when it comes to connecting to an existing Database Engine on the remote Server. On Ubuntu 18.04, if there is something that differentiates Linux based System from others is the level of permission in the File System, therefore, it is important to know the permissions for Linux based System in order to serve yourself and the team some time. These permissions can be so hectic to get right if you just find a random code online and implement it. Make sure you understand what permission level code presents, keep in mind that certain application like Drupal 8 and others requires the folder or File System to have a certain level of security in order to access and read files.
In order to connect to the remote Server hosting the database, you need to have an SSH key file to be authenticated to log in and perform database operations. If the server does not require an SSH key file then it should permit the connection to come from your IP Address, again, it all depends on what level of security is on the Server.
As a Database Administrator, Security and smooth operation should fall within priorities. Make sure the job for backing up the database or replication (sharding) is put in place in case of disaster, the database should be recovered.
In order to give permission to an IP Address to connect to Linux based Server to perform Mysql or any other database queries go ahead and type:
sudo ufw allow from 15.15.15.0/24 or YourIP to any port 3306