I would like to know is there any way to log the mysql query error which prints on screen.
Example:
mysql -u$UserName -p$Password -D $DBName -e "ALTER TABLE collect ADD path VARCHAR( 250 ) NOT NULL AFTER my_path "
This will return duplicate column if it exists... I would like to log this error on a text file, which will help in my automation.