How it works...

This script defines a few functions that are used with Fabric. The first function, remote_server(), sets the environment variables. The local loopback IP (127.0.0.1) is put to the list of hosts. The local system user and MySQL login credentials are set and collected via getpass().

The other function utilizes the Fabric run() function to send MySQL commands to the remote MySQL server by echoing the command to the mysql executable.

The run_sql() function is a generic function that can be used as a wrapper in other functions. For example, the empty_db() function calls it to execute the SQL commands. This can keep your code a bit more organized and cleaner.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.221.126.56