Thoughts and tutorials on programming

Saturday, May 30, 2009

mingw ruby 1.9/1.8 how to install mysql from source

inspired by a question from JD[1], here's the instructions:

Looks like the only way I know of is (assuming ruby 1.9 with devkit [2]) 

1) download mysql 5.0.x windows "without installer" 
2) unzip, put/rename it to c:\mysql 
3) download mysql 2.8.1 binary from tmtm 
4) edit extconf so that anywhere it says mswin32 it now says mswin32|mingw  
4a) make sure that mysql's bin are *not* in your path [might not be ncessary, but just in case] 
5) run ruby extconf.rb -- --with-mysql-include=c:/mysql/include --with-mysql-lib=c:/mysql/lib/opt 
6) run make, then run make install 
7) make sure libmysql.dll is in your path or in current directory 8) run ruby -e 'require "mysql"' -- should work.



Roger Pack said...

here's how to install it just the binaries: said...

Thanks so much for this post, quite effective info.