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 http://www.tmtm.org/en/mysql/ruby/ 
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.

[1] http://www.ruby-forum.com/topic/188199#new
[2] http://programming-gone-awry.blogspot.com/2009/05/ruby-19-one-click-installer.html

2 comments:

Roger Pack said...

here's how to install it just the binaries:
http://blog.mmediasys.com/2009/07/06/getting-started-with-rails-and-mysql/

www.leon-3d.com said...

Thanks so much for this post, quite effective info.

Contributors

Followers