For example, you could run the following command:
echo 'SELECT user_id,set_id,problem_id,num_correct,num_incorrect,status FROM `[coursename]_problem_user` where set_id="Assignment_1"' |mysql -u webworkWrite -p webwork
(you will need to look up the password for the mysql user in your site.conf file)
This returns output like
user_id set_id problem_id num_correct num_incorrect status
student1 Assignment_1 1 0 1 0.25
student2 Assignment_1 1 0 0 0
student3 Assignment_1 1 0 0 0
The data is tab-delimited, so it is easy to import into excel. Note that you can get the data for all assignments by leaving off the where clause before the |. If you want the data saved to a file, add "> somefilename.txt" to the end of the command (without the quotes).