Search code examples
mysqldjangocursesfloating-action-button

Mysql database restoring with fab and curses in django


@hosts(['localhost'])
def start():
    import curses
    screen = curses.initscr()
    backup_file = db_backup.sql
    local("mysql -u %s -p %s < " % (
        db_username,db_name) + backup_file)

now I run this with fab start

it asks for a password, after I entered the password the screen is not responding.

Can anyone know what's happening here? if I remove curses it is working fine.


Solution

  • By suspending the curses, it will return to the terminal. where we can complete the restore database task.