Primarily I access the databases using WP CLI
(with WP CLI config file).
By default the database server on Trellis is not accessible from the outside (except you are using an external database server).
You can set up a SSH tunnel or expose the database server - but then ensure it is properly secured.
Related discussion: