When executing a MySQL restore database from file command using Git Bash in Windows such as:
mysql -u MYUSERNAME -pMYPASSWORD webfoobardb
... I'm getting the following error:
stdin is not a tty
The error came from winpty as the command is trying to redirect the output to a file and expecting terminal for interactive use. The Git bash commands should work without winpty. MySQL commands needs interactive input to password before redirecting their output. As solution, we can use Windows native command cmd.exe
to encapsulate the MySQL command:
cmd.exe /c "mysql -u MYUSERNAME -pMYPASSWORD webfoobardb