Stress test MySQL with queries captured with general log in MySQL
Here is a more direct approach using brute force mysql: Setup the general as a MyISAM table. On installation, you will find the table mysql.general_log as a CSV table.
Rather than reinventing the wheel and doing a whole lot of typing, please read my past posts:

Nov 16, 2011 : Log MySQL DB changing queries and users
Feb 11, 2012 : MySQL general log
Jan 08, 2012 : How to enable MySQL general log?

Once you get mysql.general_log converted to MyISAM and queries are getting recorded, simply access the log like any other MyISAM table.
Here is the structure of the MyISAM version of mysql.general_log
mysql&gt; show create table mysql.general_log\G
*************************** 1. row ***************************
       Table: general_log
Create Table: CREATE TABLE `general_log` (
  `event_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `user_host` mediumtext NOT NULL,
  `thread_id` int(11) NOT NULL,
  `server_id` int(10) unsigned NOT NULL,
  `command_type` varchar(64) NOT NULL,
  `argument` mediumtext NOT NULL,
  KEY `event_time` (`event_time`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
1 row in set (0.00 sec)

From here, just write all content starting with a query:
SQLSTMT=&quot;SELECT argument FROM mysql.general_log&quot;
SQLSTMT=&quot;${SQLSTMT} WHERE LEFT(argument,6) IN&quot;
SQLSTMT=&quot;${SQLSTMT} ('INSERT','UPDATE','DELETE','SELECT')&quot;
mysql -uroot -p -ANe&quot;${SQLSTMT}&quot; &gt; SQLCommands.sql

There you go.
Give it a Try !!!