# Newbie question about MySQL on Windows XP Pro

**URL:** <https://www.ruby-forum.com/t/newbie-question-about-mysql-on-windows-xp-pro/106383>\
**Category:** Ruby\
**Created:** [June 9, 2007, 1:45pm UTC](https://www.ruby-forum.com/t/newbie-question-about-mysql-on-windows-xp-pro/106383 "2007-06-09T13:45:49Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![grehom](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/47e85d/32.png) [@grehom](https://www.ruby-forum.com/u/grehom)\
**Post date:** [June 9, 2007, 1:45pm UTC](https://www.ruby-forum.com/t/newbie-question-about-mysql-on-windows-xp-pro/106383/1 "2007-06-09T13:45:49Z")

</div>

I have a brand new installation of latest Ruby:  
C:\rubysrcs\ruby\_tut\>ruby -v  
ruby 1.8.6 (2007-03-13 patchlevel 0) [i386-mswin32]

and I installed mysql:  
C:\perlsrcs\ebay\>gem install mysql  
Select which gem to install for your platform (i386-mswin32)

1. mysql 2.7.3 (mswin32)
2. mysql 2.7.1 (mswin32)
3. mysql 2.7 (ruby)
4. mysql 2.6 (ruby)
5. Skip this gem
6. Cancel installation

> 1  
> Successfully installed mysql-2.7.3-mswin32  
> Installing ri documentation for mysql-2.7.3-mswin32…  
> Installing RDoc documentation for mysql-2.7.3-mswin32…  
> While generating documentation for mysql-2.7.3-mswin32  
> … MESSAGE: Unhandled special: Special: type=17, text=""  
> … RDOC args: --op C:/ruby/lib/ruby/gems/1.8/doc/mysql-2.7.3-mswin32/  
> rdoc --exclude ext --main README –  
> quiet ext README docs/README.html  
> (continuing with the rest of the installation)

I then tried running this ruby script:

require ‘dbi’

db\_name = “cookbook”  
host\_name = “localhost”  
user\_name = “cb\_user”  
password = “cb\_pass”  
dsn = “DBI:mysql:host=#{host\_name};database=#{db\_name}”

# Connect to a database, old style

dbh = DBI.connect(dsn, user\_name, password)

# And finally, disconnect

dbh.disconnect

unfortunately all I get is:  
C:\rubysrcs\ruby\_tut\>ruby -w test\_handle.rb  
C:/Ruby/lib/ruby/site\_ruby/1.8/dbi/dbi.rb:499:in `load_driver': is not a class/module (TypeError) from C:/Ruby/lib/ruby/site_ruby/1.8/dbi/dbi.rb:401:in`\_get\_full\_driver’  
from C:/Ruby/lib/ruby/site\_ruby/1.8/dbi/dbi.rb:381:in  
`connect’  
from test\_handle.rb:11

I really did try a host of other things too, but this seemed like the  
best way to present problem!

---

<div class="post-metadata">

**Author:** ![grehom](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/47e85d/32.png) [@grehom](https://www.ruby-forum.com/u/grehom)\
**Post date:** [June 9, 2007, 3:15pm UTC](https://www.ruby-forum.com/t/newbie-question-about-mysql-on-windows-xp-pro/106383/2 "2007-06-09T15:15:59Z")

</div>

I think you need to include ‘rubygems’ as well like this:

require ‘rubygems’  
require ‘dbi’

Hope that helps 🙂

---

<div class="post-metadata">

**Author:** ![grehom](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/47e85d/32.png) [@grehom](https://www.ruby-forum.com/u/grehom)\
**Post date:** [June 9, 2007, 5:26pm UTC](https://www.ruby-forum.com/t/newbie-question-about-mysql-on-windows-xp-pro/106383/3 "2007-06-09T17:26:17Z")

</div>

No, thanks but it didn’t work:

C:/Ruby/lib/ruby/site\_ruby/1.8/dbi/dbi.rb:499:in `load_driver': is not a class/module (TypeError) from C:/Ruby/lib/ruby/site_ruby/1.8/dbi/dbi.rb:401:in`\_get\_full\_driver’  
from C:/Ruby/lib/ruby/site\_ruby/1.8/dbi/dbi.rb:381:in  
`connect’  
from test\_handle.rb:12
