When working with Drush, we have the ability to use Drush aliases. A Drush alias contains a configuration that allows the tool to connect to a remote server and interact with that server's installation of Drush.
You need to have Drush installed on your remote server in order to use a site alias for it.
The sql-dump command executes the proper dump command for the database driver, which is typically MySQL and the mysqldump command. It streams to the terminal and must be piped to a destination. When piped to a local SQL file, we can import it and execute the create commands to import our database schema and data.
With the sql-cli command, we will be able to execute SQL commands to the database through Drush. This allows us to redirect the file contents to the sql-cli command and run the set of SQL commands. With the data imported, the sql-sanitize command replaces usernames and passwords.
Finally, the sql-query command allows us to pass an SQL command directly to the database and return its results. In our recipe, we will query the users_field_data to verify that we imported our users and that emails have been sanitized.