Zberteoc
asked on
MySQL: run sql script file in command line and get the erros in a log file
When you run a sql script file in command line with MySQL you can redirect the output of the query in a file but not the errors apparently:
>mysql -uuser -ppassword < sql_script_file > output_file
If the sql_script_file returns a result like table rows they will get into the output_file but if there is an error within the script it is not redirected to the outpyt_file but only to the console.
How can I get the errors from a script file to be saved to a output_file with MySQL.
>mysql -uuser -ppassword < sql_script_file > output_file
If the sql_script_file returns a result like table rows they will get into the output_file but if there is an error within the script it is not redirected to the outpyt_file but only to the console.
How can I get the errors from a script file to be saved to a output_file with MySQL.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks, that was it!
See complete command line reference below -
http://www.techotopia.com/index.php/The_mysql_Command-Line_Tool