user2940867 user2940867 - 1 year ago 127
MySQL Question

Get output from mysql query file source

Can I retrieve output from mysql for the querys inside the file

after the import?

mysql --host=localhost --user="root" --password="123456" --database=mytest --execute="SOURCE /var/www/test/WebService/public/tmp/querys.sql"

Answer Source

Redirect the input of mysql to the file. To get the information messages like 1 row inserted, add the --verbose option.

mysql --verbose --host=localhost --user="root" --password="123456" --database=mytest < /var/www/test/WebService/public/tmp/querys.sql

You can get more messages by using multiple --verbose options.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download