MySQL restore database from file command using Git Bash in Windows output "stdin is not a tty"

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 

Add new comment

Restricted HTML

  • Allowed HTML tags: <a href hreflang> <em> <strong> <cite> <blockquote cite> <code> <ul type> <ol start type> <li> <dl> <dt> <dd> <h2 id> <h3 id> <h4 id> <h5 id> <h6 id>
  • Lines and paragraphs break automatically.