Bug #78014 MySQL 5.7 won't load batch files
Submitted: 10 Aug 2015 20:15 Modified: 13 Aug 2015 23:38
Reporter: Dorian Gray Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: Command-line Clients Severity:S3 (Non-critical)
Version:5.7.8rc\5.6\5.5 OS:Windows (7 32-bit)
Assigned to: CPU Architecture:Any
Tags: #batchfiles

[10 Aug 2015 20:15] Dorian Gray
Description:
MySQL 5.7.8 won't load and run SQL scripts from a batch file.  I downloaded MySQL server 5.1 and it runs the SQL files without error.  Below is a sample script, the only thing I change to run the file for the 5.1 is the server version. 

How to repeat:
Run the below as a windows batch script. The output file displays only the options after launching mysql. 

:: Database connection parameters
 set MYSQL_HOME="C:\Program Files\MySQL\MySQL Server 5.7"
 set user=user1
 set password=******
 set host_name=localhost
 set db_name=test
 set max_error_count=0
 
 ATTRIB +R %logfile%   

echo ----------------------------------------
echo Starting ...

%MYSQL_HOME%\bin\mysql -u %user%  -p%password% -h%host_name% --local-infile=1 %db_name% < Table_scripts_mysql_rxn.sql  >> mysql_2.log 2>&1

%MYSQL_HOME%\bin\mysql -u%user%  -p%password% -h%host_name%  --local-infile=1 %db_name% < Load_scripts_mysql_rxn_win.sql >> mysql_2.log 2>&1

echo Finished
[11 Aug 2015 5:02] MySQL Verification Team
The issue is this:

"E:\mysql-5.7.8-rc-win32"\bin\mysql -uuser1  -hlocalhost  test
doesn't work, but

"E:\mysql-5.7.8-rc-win32\bin\mysql" -uuser1  -hlocalhost  test
does work.

there is a known bug for this, but cannot find it!
[13 Aug 2015 23:38] MySQL Verification Team
How Shane already commented:

c:\>"Program Files\MySQL\MySQL Server 5.6"\bin\mysql -uroot -p
Enter password: ******
ERROR 1049 (42000): Unknown database '\bin\mysql'

c:\>"Program Files\MySQL\MySQL Server 5.6\bin\mysql" -uroot -p
Enter password: ******
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.6.25-log MySQL Community Server (GPL)

Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
[17 Aug 2015 18:47] MySQL Verification Team
the last problem i remember with running mysql client using strange paths was https://bugs.mysql.com/bug.php?id=60858