Export WordPress database with WP-CLI

$ wp db export
Exports your database to databasename.sql file.