I created a patch to build MySQL/Ruby on mswin32. With this patch, just type:
> ruby extconf.rb --with-opt-include=../mysql-4.1.21-win32/include \
--with-opt-lib=../mysql-4.1.21-win32/lib/opt
> nmake
Then you'll get mysql.so. Really easy.
If libmysql.dll is built by VC7 or later, there may be a problem with GC. It depends on whether MySQL/Ruby releases memory allocated by libmysql.dll using free()/xfree() or not.