# Easy way to make Rails use MySQL on Windows?

**URL:** <https://www.ruby-forum.com/t/easy-way-to-make-rails-use-mysql-on-windows/188523>\
**Category:** Rails\
**Created:** [May 13, 2010, 10:59am UTC](https://www.ruby-forum.com/t/easy-way-to-make-rails-use-mysql-on-windows/188523 "2010-05-13T10:59:42Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![winterheat](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/7993a0/32.png) [@winterheat](https://www.ruby-forum.com/u/winterheat)\
**Post date:** [May 13, 2010, 10:59am UTC](https://www.ruby-forum.com/t/easy-way-to-make-rails-use-mysql-on-windows/188523/1 "2010-05-13T10:59:42Z")

</div>

I set up Rails from scratch using the methods on:

[http://rubyonrails.org/download](http://rubyonrails.org/download)

and also:

gem install sqlite3-ruby  
download sqlite3.dll into c:\ruby\bin  
change config/database.yml adapter lines for dev, test, prod all to  
sqlite3

so sqlite3 can be used now…

but what if i also installed MySQL on c:\Program Files

Is there an easy way to make Rails work with MySQL?

if i use

gem install mysql

there will be lots of errors saying

No definition for next\_result  
…

---

<div class="post-metadata">

**Author:** ![winterheat](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/7993a0/32.png) [@winterheat](https://www.ruby-forum.com/u/winterheat)\
**Post date:** [May 13, 2010, 11:30am UTC](https://www.ruby-forum.com/t/easy-way-to-make-rails-use-mysql-on-windows/188523/2 "2010-05-13T11:30:53Z")

</div>

Yes, gem install mysql is needed.  
But, I’m not sure what do you mean lots of errors.  
Maybe you should post your errors here.

---

<div class="post-metadata">

**Author:** ![winterheat](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/7993a0/32.png) [@winterheat](https://www.ruby-forum.com/u/winterheat)\
**Post date:** [May 13, 2010, 11:41am UTC](https://www.ruby-forum.com/t/easy-way-to-make-rails-use-mysql-on-windows/188523/3 "2010-05-13T11:41:45Z")

</div>

Jette Chan wrote:

> Yes, gem install mysql is needed.  
> But, I’m not sure what do you mean lots of errors.  
> Maybe you should post your errors here.

sure, a sample run is:

C:\Software Projects\ror\shov6\>gem install mysql  
Successfully installed mysql-2.8.1-x86-mingw32  
1 gem installed  
Installing ri documentation for mysql-2.8.1-x86-mingw32…

No definition for next\_result

No definition for field\_name

No definition for field\_table

No definition for field\_def

No definition for field\_type

No definition for field\_length

No definition for field\_max\_length

No definition for field\_flags

No definition for field\_decimals

No definition for time\_inspect

No definition for time\_to\_s

No definition for time\_get\_year

No definition for time\_get\_month

No definition for time\_get\_day

No definition for time\_get\_hour

No definition for time\_get\_minute

No definition for time\_get\_second  
…

---

<div class="post-metadata">

**Author:** ![winterheat](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/7993a0/32.png) [@winterheat](https://www.ruby-forum.com/u/winterheat)\
**Post date:** [May 13, 2010, 11:49am UTC](https://www.ruby-forum.com/t/easy-way-to-make-rails-use-mysql-on-windows/188523/4 "2010-05-13T11:49:02Z")

</div>

OK. Now I know…  
I thought t you can see “1 gem installed”  
So, it means you’ve already finished install mysql gem now.  
And the following errors come from when installation the documentation.

Actually you already can use this gem now.

---

<div class="post-metadata">

**Author:** ![winterheat](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/7993a0/32.png) [@winterheat](https://www.ruby-forum.com/u/winterheat)\
**Post date:** [May 13, 2010, 11:53am UTC](https://www.ruby-forum.com/t/easy-way-to-make-rails-use-mysql-on-windows/188523/5 "2010-05-13T11:53:29Z")

</div>

Jette Chan wrote:

> OK. Now I know…  
> I thought t you can see “1 gem installed”  
> So, it means you’ve already finished install mysql gem now.  
> And the following errors come from when installation the documentation.
> 
> Actually you already can use this gem now.

but when i use

[http://localhost:3000](http://localhost:3000)

and click on the

About your applicationâ€™s environment

the box will say error…

right now MySQL is a command line app, does it need to be run as a  
background process?

and i guess when i create the project, it is better to use

rails myapp -d mysql

?

---

<div class="post-metadata">

**Author:** ![winterheat](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/7993a0/32.png) [@winterheat](https://www.ruby-forum.com/u/winterheat)\
**Post date:** [May 13, 2010, 9:19pm UTC](https://www.ruby-forum.com/t/easy-way-to-make-rails-use-mysql-on-windows/188523/6 "2010-05-13T21:19:18Z")

</div>

On May 13, 11:53 am, Jian L. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> but when i use
> 
> [http://localhost:3000](http://localhost:3000)
> 
> and click on the
> 
> About your application’s environment
> 
> the box will say error…

What error ?

> right now MySQL is a command line app, does it need to be run as a  
> background process?

When you installed mysql it should have installed some graphical  
utilities that you can use to start up the server process (it may have  
already started it for you). You’ll also need to edit your  
database.yml to refer to the instance of mysql on your machine (it may  
not be a bad idea to look at a rails app created with -d mysql if  
you’re not familiar with how this looks)

Fred
