You could either:
-
Use a program such as Sequel Pro to connect remotely and then export. Trellis docs: https://roots.io/trellis/docs/database-access
-
Connect to the server via SSH and export the database via WP CLI. WP CLI doc: http://wp-cli.org/commands/db/export
-
Use a plugin (as @pixeline mentioned)
There’s also a great thread about leveraging WP-CLI aliases to help automate all of this: Leveraging WP-CLI Aliases in Your WordPress Development Workflow.