# mySQL connection error (for the love of sweet jebus)

**URL:** <https://www.ruby-forum.com/t/mysql-connection-error-for-the-love-of-sweet-jebus/179601>\
**Category:** Rails\
**Created:** [November 30, 2009, 6:08am UTC](https://www.ruby-forum.com/t/mysql-connection-error-for-the-love-of-sweet-jebus/179601 "2009-11-30T06:08:27Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![lyh](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/b9e5f3/32.png) [@lyh](https://www.ruby-forum.com/u/lyh)\
**Post date:** [November 30, 2009, 6:08am UTC](https://www.ruby-forum.com/t/mysql-connection-error-for-the-love-of-sweet-jebus/179601/1 "2009-11-30T06:08:27Z")

</div>

This will come off as an incredibly noob question so please bear with  
me.

I’ve “installed” (i.e. extracted and copied) Instant Rails 1.7 on my  
Windows XP machine for the purposes of running through O’Reilly’s RoR  
tutorial ([O'Reilly Media - Technology and Business Training](http://oreilly.com/pub/a/ruby/archive/rails-revisited.html))

I am having the hardest time connecting to mysql. I keep on getting  
this error:

“ERROR 2003 : Can’t connect to MYSQL server on ‘localhost’  
\<10061\>”

I deploy ruby via the Instant Rails executable and then by initiating  
mongrel.

inputing either “mysql -u root” or “mysql -u root -p” both return the  
error.

I have searched various blog postings, forum threads, etc on google  
(including [Instant Rails mySQL Error - Rails - Ruby-Forum](http://www.ruby-forum.com/topic/127122)) to no avail.

I am at wit’s end.

For the love of jebus, can someone please help me?

Please not the following detail:

1. I also have Ruby 1.9.1 installed
2. I HAD the last safe build of mySQL installed (via one click .msi  
installer) but uninstalled prior to loading Instant Rails

---

<div class="post-metadata">

**Author:** ![lyh](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/b9e5f3/32.png) [@lyh](https://www.ruby-forum.com/u/lyh)\
**Post date:** [November 30, 2009, 8:22am UTC](https://www.ruby-forum.com/t/mysql-connection-error-for-the-love-of-sweet-jebus/179601/2 "2009-11-30T08:22:54Z")

</div>

Hi Louie

First check whether you installed mysql gem for rails (in my case its  
mysql (2.7))

and then make sure you can login to mysql server,

you can issue the following command in your command prompt

mysql -h localhost -u root -p followed by your password

where localhost is your mysql server host  
root is your user name

As per the details you have given I think you cannot connect to mysql  
from the command line also…

cheers,  
Sameera

---

<div class="post-metadata">

**Author:** ![lyh](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/b9e5f3/32.png) [@lyh](https://www.ruby-forum.com/u/lyh)\
**Post date:** [November 30, 2009, 7:23pm UTC](https://www.ruby-forum.com/t/mysql-connection-error-for-the-love-of-sweet-jebus/179601/3 "2009-11-30T19:23:12Z")

</div>

Hi Louie,

One possible reason would be you haven’t start mysql server

check this out (I haven’t tried this as I’m on Linux :D)  
[http://dev.mysql.com/doc/refman/5.1/en/windows-start-service.html](http://dev.mysql.com/doc/refman/5.1/en/windows-start-service.html)

cheers,  
Sameera

---

<div class="post-metadata">

**Author:** ![lyh](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/b9e5f3/32.png) [@lyh](https://www.ruby-forum.com/u/lyh)\
**Post date:** [November 30, 2009, 5:54pm UTC](https://www.ruby-forum.com/t/mysql-connection-error-for-the-love-of-sweet-jebus/179601/4 "2009-11-30T17:54:05Z")

</div>

Hi Sameera,

Thanks for your reply. You are correct I don’t seem to be able to log  
into mySQL. I thought running the InstantRails executable in essence  
starts up the mySQL server?

Sameera G. wrote:

> Hi Louie
> 
> First check whether you installed mysql gem for rails (in my case its  
> mysql (2.7))
> 
> and then make sure you can login to mysql server,
> 
> you can issue the following command in your command prompt
> 
> mysql -h localhost -u root -p followed by your password
> 
> where localhost is your mysql server host  
> root is your user name
> 
> As per the details you have given I think you cannot connect to mysql  
> from the command line also…
> 
> cheers,  
> Sameera
