Closes the MySQL connection after use