From be3e939b8ebae9d30564cca43e61d8ba55002660 Mon Sep 17 00:00:00 2001 From: Alex Muller Date: Fri, 6 Nov 2015 10:44:38 +0000 Subject: [PATCH] Remove MySQL database dump after setup Otherwise it would just hang about on the slave machine. --- mysql.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mysql.py b/mysql.py index 1d39455..158a5b7 100644 --- a/mysql.py +++ b/mysql.py @@ -92,6 +92,8 @@ def replicate_slave_from_master(master): print('Importing MySQL database which is {0}GB, this might take a while...'.format(round(int(database_file_size) / (1024*1024*1024*1.0), 1))) run('sudo -i mysql -uroot < dump.sql') + run('rm dump.sql') + run_mysql_command("START SLAVE") run_mysql_command("SET GLOBAL slow_query_log=ON")