Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Run mysql script by batch script

I've searched for hours, there are many posts or tutorials but I couldn't run my batch script.

on dos prompt this code works fine:

-u root -h localhost -p******** siir_07 dumper.sql

but this gives error with batch:

"c:\program files\mysql\mysql server 5.5\bin\mysql.exe" "-u root -h localhost -p******** siir_07 dumper.sql"

the error is:

ERROR 1045 (28000): Access denied for user ' root -h localhost -p** siir_07 dumper.s'@'localhost' (using password: NO)

like image 904
nikel Avatar asked Dec 21 '22 03:12

nikel


1 Answers

Z:\test.bat :

Z:\webserver\mysql\bin\mysql.exe -u test -p test < test.sql

When I run it from command line, everything is OK. So, try to remove quotes and redirect input using <.

like image 141
Timur Avatar answered Jan 13 '23 18:01

Timur