0

I have the following goal: import an sql file from Git Bash in Windows inside a script. (I have mysql 8, but 5.7 the same as far as I tried.)

The commands, which I tried individually:

$ mysql -u root -p {pw} --database={db}  < xy.sql
(no answer)

$ mysql.exe -u root -p {pw} --database={db}  < xy.sql
(no answer)

$ winpty mysql.exe -u root -p {pw} --database={db}  < xy.sql
stdin is not a tty

$ winpty mysql.exe -u root -p --database={db}  < xy.sql
stdin is not a tty

$ winpty mysql.exe -u root -p
Enter password:
 
$ winpty mysql.exe -u root -p {pw}
Enter password:

$ mysql -u root -p
(no answer)

$ winpty mysql -u root -p
Enter password:

I'd be happy of workarounds and explanations, too, of course.

v-peter
  • 1
  • 2
  • 1
    There should be no space between `-p` option and password. Something like `mysql -u root -pMyRootPassw00rd` – DevilaN May 22 '23 at 09:51

0 Answers0