I am calling mysql.exe from Java to load a database. Because the process just hangs, I need to create a command file and pass in the username and password.
Example contents of command.bat:
mysql --user="%1" --password="%2" mydatabase < myscript.sql
The problem is that I cannot see the output of the mysql command to see if there were any errors. They display on the command line, but I cannot seem to capture them in a file for parsing or an InputStream.
How can I see the output of the mysql command?
NOTE: Calling mysql.exe directly from Java hangs because the mysql does not appear to be sending the information to the buffer.
NOTE: We are using mysql.exe instead of JDBC because we need to update things like triggers. In order to submit all the statements to the db, we would need to parse all the commands and pass them in one at a time.
NOTE: This is a running MySQL database that needs to be upgraded.