# Ask libmysql.dll

**URL:** <https://www.ruby-forum.com/t/ask-libmysql-dll/136385>\
**Category:** Rails\
**Created:** [May 1, 2008, 3:37pm UTC](https://www.ruby-forum.com/t/ask-libmysql-dll/136385 "2008-05-01T15:37:09Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![manika](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/8c91f0/32.png) [@manika](https://www.ruby-forum.com/u/manika)\
**Post date:** [May 1, 2008, 3:37pm UTC](https://www.ruby-forum.com/t/ask-libmysql-dll/136385/1 "2008-05-01T15:37:09Z")

</div>

When I run controller [http://127.0.0.1:3000/test](http://127.0.0.1:3000/test)  
it asks for libmysql.dll  
Errno::ECONNREFUSED in TestController#index

No connection could be made because the target machine actively refused  
it. - connect(2)

RAILS\_ROOT: C:/ruby/student  
Application Trace | Framework Trace | Full Trace

i get it in mysql but when i install it in bin folder it says unable to  
connect.how can i connect it with ruby on rails  
thanks  
mani

---

<div class="post-metadata">

**Author:** ![manika](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/8c91f0/32.png) [@manika](https://www.ruby-forum.com/u/manika)\
**Post date:** [May 1, 2008, 3:53pm UTC](https://www.ruby-forum.com/t/ask-libmysql-dll/136385/2 "2008-05-01T15:53:43Z")

</div>

Go to your mysql/bin  
and copy paste libmysql.dll to ruby/bin  
after that restart your webrick or ruby server.

> i get it in mysql but when i install it in bin folder it says unable to  
> connect.how can i connect it with ruby on rails  
> thanks

Check first what is your mysql server run? if your mysql is ok. then  
check your config/database.yml

check all configuration there :

development:  
adapter: mysql  
database: database\_name  
username: root  
password: my\_password  
host: localhost

You should ensure that all login information to database mysql is  
correct.

Good Luck,

Reinhart  
[http://teapoci.blogspot.com](http://teapoci.blogspot.com)

---

<div class="post-metadata">

**Author:** ![manika](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/8c91f0/32.png) [@manika](https://www.ruby-forum.com/u/manika)\
**Post date:** [May 2, 2008, 6:37am UTC](https://www.ruby-forum.com/t/ask-libmysql-dll/136385/3 "2008-05-02T06:37:38Z")

</div>

I have done what u said I have copy paste libmysql.dll to ruby/bin but  
now I am run [http://127.0.0.1:3000/](http://127.0.0.1:3000/)

i found unable to connect(problem loading page).  
I am sending u my database.yaml file as an attechment  
I have created database by  
create database db\_development;  
create database db\_test;  
create database db\_deployment;

Rails T. wrote:

> Go to your mysql/bin  
> and copy paste libmysql.dll to ruby/bin  
> after that restart your webrick or ruby server.
> 
> > i get it in mysql but when i install it in bin folder it says unable to  
> > connect.how can i connect it with ruby on rails  
> > thanks
> 
> Check first what is your mysql server run? if your mysql is ok. then  
> check your config/database.yml
> 
> check all configuration there :  
> [http://127.0.0.1:3000/](http://127.0.0.1:3000/)  
> development:  
> adapter: mysql  
> database: database\_name  
> username: root  
> password: my\_password  
> host: localhost
> 
> You should ensure that all login information to database mysql is  
> correct.
> 
> Good Luck,
> 
> Reinhart  
> [http://teapoci.blogspot.com](http://teapoci.blogspot.com)

---

<div class="post-metadata">

**Author:** ![manika](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/8c91f0/32.png) [@manika](https://www.ruby-forum.com/u/manika)\
**Post date:** [May 2, 2008, 7:50am UTC](https://www.ruby-forum.com/t/ask-libmysql-dll/136385/4 "2008-05-02T07:50:13Z")

</div>

your configuration is correct, what is your problem right now?

IF you can reach [http://127.0.0.1:3000/](http://127.0.0.1:3000/) successfully, it means that your  
rails is successfully connected to database.

If you have problem in loading page you should check your controller and  
corresponding method.

Example:

class SuperHeroController \< ApplicationController

def index  
#index page business logic here  
end

def listing  
#listing page business logic here  
end

end

so that your url will be [http://127.0.0.1:3000/super\_hero/listing](http://127.0.0.1:3000/super_hero/listing)

if you want [http://127.0.0.1:3000/](http://127.0.0.1:3000/) redirect to your main page you should  
do modification at app\_name/config/route.rb:

ActionController::Routing::Routes.draw do |map|  
map.connect ‘’, :controller =\> “super\_hero”

…

end

don’t forget to delete index.rhtml or index.html.erb in app\_name/public/

if you need me, you can chat online here:

Yahoo Messenger : sxapril  
MSN : removed\_email\_address@domain.invalid

Good Luck,  
reinhart  
[http://teapoci.blogspot.com](http://teapoci.blogspot.com)
